Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
I am using a html marque tag in which i am moving images.
I want to stop the image moving whenever i hover the mouse on it.

I am using this code

XML
<marquee  loop="infinite"   >


                 <asp:Image ID="Img1" name="img1" runat="server" Height="100" Width="80"  ImageUrl="~/images/sonyd.jpg"  onmouseover="this.setAttribute('scrollamount', 0, 0);" onmouseout="this.setAttribute('scrollamount', 6, 0);"/>
                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  <asp:Image ID="Image2" runat="server" Height="100" Width="80" ImageUrl="~/images/camc.jpg"/>
                  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  <asp:Image ID="Image3" runat="server" Height="100" Width="80" ImageUrl="~/images/laptop.jpg"/>
                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                   <asp:Image ID="Image4" runat="server" Height="100" Width="80" ImageUrl="~/images/galaxy.jpg"/></marquee>



but its not working.
When i write event in marque tag it works but i want to stop it when i hover on image and not on any other pLACE IN MARQUE tag.
Posted

Stop it by not using marque in first place. Marque is evil. For many users, this is a sufficient reason to avoid your Web site completely.

—SA
 
Share this answer
 
Comments
Tech Code Freak 1-Feb-12 2:26am    
Why? Genuinely I don't know the reason. Plz explain. By the way, 5up for bringing that to my notice!
Michel [mjbohn] 1-Feb-12 2:57am    
I agree.
Same applies for blinking text and sound!
use as
C#
<marquee onmouseover="this.stop();"  onmouseout="this.start();" SCROLLAMOUNT=5> 


                          
                  <asp:image id="Image3" runat="server" height="100" width="80" imageurl="~/images/laptop.jpg" xmlns:asp="#unknown" />
                           
                   <asp:image id="Image4" runat="server" height="100" width="80" imageurl="~/images/galaxy.jpg" xmlns:asp="#unknown" />

</marquee>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900