Results 1 to 3 of 3

Thread: Scroll code works but image not being loaded

  1. #1
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default Scroll code works but image not being loaded

    Here is the page in question http://www.theremotedoctor.co.uk/kar1stream.html

    Ive applied an id anchor at the point i need to scroll to.
    Ive applied this code to a button link to go to the anchor once clicked on <li><a href="#scrolltohere" class="scroll">Scroll Test</a>

    What i have been trying to do for the last few hours is to integrate the scrolling code into my existing code,so when i click my existing code it scrolls to the anchor AND loads the image.
    What i am finding is that the scrolling side of it will work but the image is not being loaded,due to the two href i assume ?

    Here is my existing code i need to integrate it to.
    <li><a href="javascript:" onclick="replaceMainImage('m-images/photos/HONDA010.jpg', 'Honda010','<b>£70.00</b><br>TEXT LINE 1<br>TEXT LINE 2<br>TEXT LINE 3<br><b>Uk Recorded £2.50</b><br><b>International Signed For £10.00</b><br><scan class=drColor>The Remote Doctor</scan>')">Stream key 2003-2006</a></li>

    If you can advise what i need to do for this to work i would be most grateful.

    Thanks once again.
    Last edited by theremotedr; 04-12-2015 at 07:37 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This will make it scroll:

    Code:
    location.hash = 'iosdevicescroll';
    You can add it here:

    Code:
            function replaceMainImage(imgSrc, partNumber, myContent) {
    	    location.hash = 'iosdevicescroll';
                $('#content a').get(0).search = 'partNumber=' + partNumber;
                $('#mainImage').attr('src', imgSrc)
                $('#mainIma . . .
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Nov 2011
    Location
    Cider Region
    Posts
    1,132
    Thanks
    158
    Thanked 3 Times in 3 Posts

    Default

    Hi,
    Kind of there.
    On this page i have 2 selections.
    If i click the first selection picture is loaded and it also scrolls into view.
    BUT
    If i then select the second selection the picture loads but no scroll happens unless i manually do it.

    On some pages i may have 3,4,5,6 selection.
    Last edited by theremotedr; 04-12-2015 at 06:45 PM.

Similar Threads

  1. Javascript code for text & image scroller works in Firefox but not IE
    By tmorelli in forum Dynamic Drive scripts help
    Replies: 7
    Last Post: 03-26-2013, 07:53 PM
  2. Replies: 1
    Last Post: 09-13-2009, 05:20 PM
  3. Resolved jQuery code only works in Fx and Chrome
    By Snookerman in forum JavaScript
    Replies: 4
    Last Post: 12-27-2008, 09:20 AM
  4. simple code works on ie but not in ff
    By bojomojo in forum JavaScript
    Replies: 2
    Last Post: 12-16-2008, 11:01 PM
  5. Code that works for FF, not IE
    By Agent Moose in forum JavaScript
    Replies: 8
    Last Post: 12-24-2007, 10:08 PM

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
  •