We'd like to remind Forumites to please avoid political debate on the Forum. This is to keep it a safe and useful space for MoneySaving discussions. Threads that are - or become - political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

Help with a Java script for images

Hi guys

If you take a look at

https://www.jessicamckeegan.co.uk/test.html

I want the EGs at the bottom to be thumbnails and without changing or refreshing the page the big pic comes up

Hope this makes sense?

Really desperate for some help

Thanks
I need a cig...
«1

Comments

  • bluboy
    bluboy Posts: 336 Forumite
    Part of the Furniture Combo Breaker
    If you're happy with modifying the html/javascript yourself take a look here -
    http://javascript.internet.com/image-effects/onmouseover-image-gallery.html
    It does what you're trying to do.

    Look for the "Source Code" tab at the top of the page just above the pics and it will tell you what you need to add to the 'head' and 'body' sections of your source code. It's then just a matter of changing filenames to correspond with your own pictures.
    (edit - In the link they have used a small separate thumbnail image to represent each full size image that appears. )

    You could also preload your pictures to speed up the process when people hover over a thumbnail.
    I notice your thumbnails are 44x44 and your big pics are 560x328 so you would need to add the following into the <head> section of your code (remembering to change file names and repeating for how ever many pictures you want to preload) -

    <SCRIPT LANGUAGE="JavaScript">
    <!-- hide from none JavaScript Browsers

    Image1= new Image(560,328)
    Image1.src = "imagea.gif"

    Image2 = new Image(44,44)
    Image2.src = "imagea_sml.gif"

    Image3= new Image(560,328)
    Image3.src = "imageb.gif"

    Image4 = new Image(44,44)
    Image4.src = "imageb_sml.gif"
    // End Hiding -->
    </SCRIPT>
  • thank you

    ill give it a go!
    I need a cig...
  • hi!

    Ive managed to sort out some coding for the site.

    But the top navigation bar isnt visible until you actually click on an image?

    Im not sure why this has happened. Can someone advice?

    Thanks
    I need a cig...
  • sorted it

    realised i had

    $('.nav').css('display','none');

    in the code
    I need a cig...
  • A better and more popular way to work with thumbnails and galleries is to use a JavaScript lightbox.
  • ive looked at that and didnt like it
    I need a cig...
  • im having issues with the placement of the clicked image, can anyone help?
    I need a cig...
  • bluboy
    bluboy Posts: 336 Forumite
    Part of the Furniture Combo Breaker
    mikem1986 wrote: »
    im having issues with the placement of the clicked image, can anyone help?
    Give me a minute and I'll have a look.
    Be warned it might be tomorrow before I have anything constructive to offer though! Too much white wine! At least I think its wine.

    In the meantime what do you want to see happen?
  • bluboy
    bluboy Posts: 336 Forumite
    Part of the Furniture Combo Breaker
    Looks alright in Firefox but not in IE.
    But you've stepped into the world of prepacked JQuery - cant be much help I'm afraid.

    I thought the earlier version was much easier to follow and amend yourself.
  • just noticed about IE!

    argh!
    I need a cig...
This discussion has been closed.
Meet your Ambassadors

Categories

  • All Categories
  • 347.1K Banking & Borrowing
  • 251.6K Reduce Debt & Boost Income
  • 451.7K Spending & Discounts
  • 239.3K Work, Benefits & Business
  • 615.2K Mortgages, Homes & Bills
  • 175K Life & Family
  • 252.7K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 15.1K Coronavirus Support Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.