Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Sequence of images behaving oddly in Opera (and some cursor stuff)
Old 04-24-2009, 07:12 AM Sequence of images behaving oddly in Opera (and some cursor stuff)
Junior Talker

Posts: 1
Location: London, UK
Trades: 0
Sorry, I'm a total beginner and maybe pushing my luck!

I've got a sequence of images that can be clicked through, the final image linking to a new page. This works well in all browsers but Opera where, on clicking that final image, 'Image' flashes on screen before loading the new page - and clicking back from the new page displays just this undefined 'Image'. Is there something wrong with the code?

Also, is there a neater way of displaying and maintaining the pointer when over the image?

Thanks for reading!

Code:
<script type="text/javascript" language="javascript">
pics = ["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg"];
var index = 1;
function showNextPic() {
    document.getElementById('imagePlaceholderA').src = pics[index];
    if (index == pics.length) {document.getElementById('link').href = "index.html"; }
    index++;
}
</script>

<style type="text/css">
.styleCursorHand  {
    cursor: pointer;
}
.styleCursorNormal  {
    cursor: auto;
}
</style>

</head>
<body>
<table>
  <tr> 
    <td>
<a id="link"><img src="1.jpg" id="imagePlaceholderA" onClick="showNextPic()" onMouseOver="this.className='styleCursorHand';" onClick="this.className='styleCursorHand';" onMouseDown="this.className='styleCursorHand';" onMouseOut="this.className='styleCursorNormal';"></a>
    </td>
  </tr>
</table>
</body>
Suresure is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Reply     « Reply to Sequence of images behaving oddly in Opera (and some cursor stuff)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.08659 seconds with 12 queries