PDA

View Full Version : Resolved Scroll code works but image not being loaded



theremotedr
04-12-2015, 03:14 PM
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.

jscheuer1
04-12-2015, 05:51 PM
This will make it scroll:


location.hash = 'iosdevicescroll';

You can add it here:


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

theremotedr
04-12-2015, 06:10 PM
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.