Results 1 to 3 of 3

Thread: onmouseover and onclick in one <div> tag possible? / thumbnailviewer2.js

  1. #1
    Join Date
    Apr 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile onmouseover and onclick in one <div> tag possible? / thumbnailviewer2.js

    1) Script Title: thumbnailviewer2.js

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...thumbnail2.htm

    3) Describe problem:

    Hello!
    Ok. I'm having a problem with some thumbnails.
    I am using an external .js file from http://www.dynamicdrive.com which is thumbnailviewer2.js as well as a <div> tag which looks like this--->

    <div class="thumb"><a href="images/big.jpg" rel="enlargeimage::mouseover" rev="left" title><img src="images/thumb.jpg" border="0" alt="pic" height="65" width="65" /></a></div>

    When i hover over the thumbs they are displayed large like they should.
    What I would like as well is when a thumb is clicked - a new window shall open with some more enlarged images. (eg: a new .htm)
    I've tried to implement 'onClick' but it did override the 'onmouseover'...

    I'm quite new to Javascript. Anyway. I've searched the net but can't find an answer.

    Hope you can help .

    Doreen
    Last edited by ddadmin; 04-23-2008 at 06:52 AM.

  2. #2
    Join Date
    Apr 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Arrow update

    Ok. searching through the forum I found this-->

    >>You could instead set the target="_new" in the thumbnailviewer2.js script (addition red):

    Code:

    imageHTML='<a target="_new" href="'+dest+'">'+imageHTML+'</a>'

    You can use a link in the title attribute:

    Code:

    title="This is an <a href='http://www.dynamicdrive.com' target='_new'>example</a>"

    <<

    and I've done this and it opens the picture in a new window...

    nice.. but what I need is a new window containing another .htm with more views of the pic itself and not only the one which was shown when hovered over....

    I hope this is understandable.

    Thanks for your help!

    Doreen

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    The script by default disables the onClick action within the image thumbnail links, yes. You can re-enable it by first removing the below lines inside the .js file:

    Code:
    pagelinks[i]["onclick"]=function(){ //Cancel default click action
    return false
    Then, inside your thumbnail link, add an onClick event handler and set it to open a page onClick, for example:

    Code:
    <a href="http://www.nasa.gov/images/content/167040main_image_feature_738_ys_4.jpg" rel="enlargeimage::mouseover" rev="loadarea::http://www.dynamicdrive.com" title="This is an example" onClick="window.open('http://google.com')">Thumbnail Example 1</a>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •