This is a discussion on "Javascipt or a:hover???????" within the Web Page Design section. This forum, and the thread "Javascipt or a:hover??????? are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Javascipt or a:hover???????
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Javascipt or a:hover???????
Hello,
I am reading and hearing conflicting things on what to use for rollovers. I am interested in what people are using, either Javascript or a: hover or both? And if you write the reason you are using it that would be very helpful. Thanks, Tom |
|
|
|
#2
|
|||
|
|||
|
Re: Javascipt or a:hover???????
|
|
#3
|
|||
|
|||
|
Re: Javascipt or a:hover???????
I agree, don't clutter your site with javascript. It just slows things down.
|
|
#4
|
||||
|
||||
|
Re: Javascipt or a:hover???????
For simple rollovers, use CSS. You may run into more advanced things that requires JavaScript, however. If done right, JavaScript most certainly won't slow things down.
|
|
#5
|
|||
|
|||
|
Re: Javascipt or a:hover???????
I should clarify what I said earlier. I have experienced first hand the difference between using css and javascript for rollover images. Hands down css takes the lead. This does not mean that you should throw out javascript just avoid using it in areas that css does a better job. They cannot take each others place each is designed for a specific purpose.
The pros of using css is that it styles your page easily and if its not supported by a browser generally your browser will fall back on some basic old fashioned html which will still be functional in "most" cases, where as with javascript if it is turned off or not supported then you will most likely have a problem loading that part of the page or have low functionality if any at all. What it comes down to is not to cut either out of your arsenal but to use them in the right places. Can't say if its right or wrong to use javascript or css, its a mere preference. Hope that clears up what I was trying to say. |
|
#6
|
||||
|
||||
|
Re: Javascipt or a:hover???????
Quote:
|
|
#7
|
|||
|
|||
|
Re: Javascipt or a:hover???????
I disagree, this can also happen when a internet user decides he doesn't want javascript enabled on his browser because too many people have abused it. Or if a user just doesn't have it enabled because he doesn't know any better. When designing websites I feel that you need to expect that the user wont be able to figure out if he has javascript enabled or not. Again I use javascript , its not bad but... there are cons to it. You have no control of settings people choose on their browser.
|
|
#8
|
||||
|
||||
|
Re: Javascipt or a:hover???????
Anyone who uses JavaScript should make it so that if it disabled for any reason, the functionality of the site is still there. I code that way, and if, on that rare occasion, someone comes to my site without JavaScript on, they can still use it normally, just without some of the bells and whistles. I'm one of the few people that codes this way, but I can assure you, I can make a darn amazing site using JavaScript, but it'll be just as functional to those without it.
|
|
#9
|
|||
|
|||
|
Re: Javascipt or a:hover???????
Ryan I am not in disagreement with you. I'm commenting on the post for someone wondering what would be better to use. And in this case my opinion is use css for image overs, if your opinion is js then I have no problem with that. I'm not here to argue but provide advice and opinions on what will cause less complications. For someone advanced in javascript as yourself then it may be the way to go but for someone asking a question about what to use my "opinion" would be css. Either way neither one of us are wrong because it is preference.
|
|
#10
|
||||
|
||||
|
Re: Javascipt or a:hover???????
Naw, I kind of went a little OTT on that. I say JS rollovers are usually not preferred over CSS rollovers, but they can do much more than CSS can with regards to usability in this matter.
|
|
#11
|
||||
|
||||
|
Re: Javascipt or a:hover???????
:hover all the way, until you until to do it on something other than a link tag,
then you need this: Whatever:hover ps.: Karinne, there's an error (I think) on you tutorial:
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
#12
|
|||
|
|||
|
Re: Javascipt or a:hover???????
Oooops ... yes ... thanks for letting me know Diego! All fixed now!
|
|
#13
|
||||
|
||||
|
Re: Javascipt or a:hover???????
No worries ;-)
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
#14
|
|||
|
|||
|
Re: Javascipt or a:hover???????
This is practical experience with a lot of opinion, so take it with a grain of salt
"... this can also happen when a internet user decides he doesn't want javascript enabled on his browser..." This really is a good reason for not using any kind of client-side scripting when css will do. Speaking as someone who blocks all javascript except for a whitelist, I will just leave a site that requires javascript to function unless it is a site I *must* visit or trust. (My bank, blizzard.com, gmail, etc...) "...Anyone who uses JavaScript should make it so that if it disabled for any reason, the functionality of the site is still there..." There are very precious few sites that are genuinely enhanced by the use of *unnecessary* jscript. I say unnecessary, because if you can make it so "the functionality of the site is still there" without any javascript working, might it be worth asking why you used it? IMHO javascript is gernerally for function, not design, layout, interfacing, or visual candy. I will agree that (especially on media sites or art-oriented ones) that the javascript is *meant* to be just pretty, and it's understood. I use mouseovers constantly via css, but I don't plan to ever use jscript because they are *always* just a visual enhancement. I don't resort to client-side script unless I must use it to make some function available. |
|
#15
|
||||
|
||||
|
Re: Javascipt or a:hover???????
I don't use Javascript because I find it pointless in my aspect of programming (not all programming , just mine). I have forms that have to be verified and I can't rely on something that "Might" work so I use ASP to verify all of my forms. Also, some people love Javascript so much that they do stupid things... like making every link a javascript event and I think they do it just to tick me off... lol.
Last Blog Entry: Happy Holidays - A Non Offensive way to say Merry Christmas? WRONG! (Dec 11th, 2007)
|
|
#16
|
||||
|
||||
|
Quote:
Which brings me to my favourite motto... "Everything in moderation makes for a perfect world!"
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
#17
|
||||
|
||||
|
Re: Javascipt or a:hover???????
I agree. When it's used correctly, though, it can blow your mind away. Google Maps comes to mind for me...
|
|
#18
|
||||
|
||||
|
Re: Javascipt or a:hover???????
Google maps, Gmail, Yahoo Mail, jQuery & Co, etc...
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
#19
|
|||
|
|||
|
Re: Javascipt or a:hover???????
As fun and spiffy as it is I would always use CSS over JS if possible. Granted some things simply require or are better with javascript.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
|