User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 391,596 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,699 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 747 | Replies: 4
Reply
Join Date: Mar 2008
Location: Belgium, Leuven
Posts: 14
Reputation: Aeneassan is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
Aeneassan's Avatar
Aeneassan Aeneassan is offline Offline
Newbie Poster

image rollover

  #1  
Apr 28th, 2008
I get flickering images when i use this code for an image rollover change, i used the same code on a different website a while back and it worked but now i only get a flicker instead of the second image...

If anybody knows why please respond (website where it's used: http://www.pektop.be )

<ul class="menulist">
      <li><a href="index.php" onmouseover="document.l1.src='menumouse_01.gif'" onmouseout="document.l1.src='images/menunorm_01.gif'"><img src="images/menunorm_01.gif" border="0" name="l1" /></a></li>
      <li><a href="index.php" onmouseover="document.l2.src='menumouse_02.gif'" onmouseout="document.l2.src='images/menunorm_02.gif'"><img src="images/menunorm_02.gif" border="0" name="l2" /></a></li>
      <li><a href="index.php" onmouseover="document.l3.src='menumouse_03.gif'" onmouseout="document.l3.src='images/menunorm_03.gif'"><img src="images/menunorm_03.gif" border="0" name="l3" /></a></li>
      <li><a href="index.php" onmouseover="document.l4.src='menumouse_04.gif'" onmouseout="document.l4.src='images/menunorm_04.gif'"><img src="images/menunorm_04.gif" border="0" name="l4" /></a></li>
      <li><a href="index.php" onmouseover="document.l5.src='menumouse_05.gif'" onmouseout="document.l5.src='images/menunorm_05.gif'"><img src="images/menunorm_05.gif" border="0" name="l5" /></a></li>
    </ul>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 2,510
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 103
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: image rollover

  #2  
May 2nd, 2008
Name is deprecated. Use ID.

You have a scoping problem. You are using the names in onmouseover and onmouseout attributes outside the area where those names are defined. You need external scripts

And I am totally sick of websites that make pictures larger when the mouse goes over them. Just leave them large!
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,774
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 330
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: image rollover

  #3  
May 3rd, 2008
According to the HTML 4.01 specification:
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").

Plus NAME attribute is deprecated for *non-form* elements; use ID instead. And a better way to access images would be document.images["imageId"]. Also, are you preloading the images?
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Join Date: Mar 2008
Location: Belgium, Leuven
Posts: 14
Reputation: Aeneassan is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 1
Aeneassan's Avatar
Aeneassan Aeneassan is offline Offline
Newbie Poster

Re: image rollover

  #4  
May 4th, 2008
Er no I'm not preloading the images, was planning on putting that in but still need to find out how
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,774
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 330
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: image rollover

  #5  
May 4th, 2008
> but still need to find out how

Find out how to preload images? Google has a lot of helpful links to get you started. If you still are facing issues, let us know.
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JavaScript / DHTML / AJAX Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 11:39 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC