PDA

View Full Version : Making something visible but untouchable...



???
02-13-2009, 04:04 PM
I don't know how cross browser this is, but you can make something invisible but still clickable by using CSS and doing "visibility: hidden;", I think. I would also assume that you can set the opacity to 0. I'm wondering if I can make something visible, but not clickable. For say, in the holiday spirit, having it be snowing on you website. It would be really lame if there was a snowflake that went over a button as you clicked it, so you ended up dragging the snowflake. If there is no simple way to do this, I could always copy every element in the page, set the opacities to 0, set the z-index to something high, and sandwich the snowflakes in between. That would be awful. Can I do it any other way?

Thanks,
Stephen

Nile
02-13-2009, 09:19 PM
You want your button to go above the snow flake?

That would be clickable, and visible...
Warning: Please include a link to the DD(or javascriptkit) script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.
Please post a link to the page on your site that contains the problematic script so we can check it out.
Please include your code so that we can take a look at it, we can't do much without it.

???
02-14-2009, 07:03 PM
Well, first of all, I don't have code. I'm asking how you do something, there's not an error. And, I don't really want the button above the snowflake, but the snowflake just to not to block click events and such from things underneath it.

Snookerman
02-14-2009, 07:35 PM
I don't think there is any way to make a visible element, that is on top of something, unclickable. The only thing that comes in mind is an article on achieving a blurry background. It's really, really far away from what you are looking for, but maybe, just maybe, you could use the technique to get what you need. The effect is rather simple, yet quite awesome:
http://css-tricks.com/blurry-background-effect/ (http://css-tricks.com/blurry-background-effect/)

Good luck!

Twey
02-14-2009, 08:04 PM
I could always copy every element in the page, set the opacities to 0, set the z-index to something high, and sandwich the snowflakes in between. That would be awful. Can I do it any other way?It would be more than awful. It would be horrific and foul and repulsive! :p

Unfortunately, no, there isn't really a better way, so I would advise avoiding it altogether. Alternatively, you could have the snowflakes fall only on areas of the page with little or no content, or have them beneath the page content, so that they only covered the background.

jscheuer1
02-15-2009, 04:25 PM
You could also just set the z-index of links, etc. - whatever you wanted higher than the snow to a high value and give them position relative.

Too bad there isn't a:


window.onsnowover

event that could tell if a flake was over a link and temporarily assume the link's properties. You could probably create one though. A library like JQuery, I believe has provisions for that sort of thing.

???
02-16-2009, 03:39 AM
Well, thanks all. I think I'll just not do it, it's not really important.

Falkon303
02-16-2009, 07:30 AM
Make the snowflakes take notice of the mouse cursor position and avoid a circumference of/area around it.

???
02-16-2009, 03:27 PM
Good idea. Besides, that would be an excuse for more useless, smooth animation. If you think of the cursor as your finger, snowflakes don't fall through your finger. Thanks.