View Full Version : Resolved Newbie with jQuery code question
theremotedr
04-10-2015, 09:59 AM
Here is the page in question http://www.theremotedoctor.co.uk/karhonda.html
As you can see the Item selection list is quite long,on this page and a couple others.
If you were to select an item at the bottom you do not get the photo shown of the item in question.
I think a jQuery code is the answer to make this happen ?
Basically when you select the item i need the page to scroll so the photo is then shown.
Currently making a selection loads the photo but its not viewable as its up the page a touch.
Please advise,many thanks.
styxlawyer
04-10-2015, 10:53 AM
You just need some extra CSS and a short piece of Javascript to switch the position of the picture from scrolling to fixed after the page has scrolled up by a certain amount.
Have a look at this page (https://css-tricks.com/scroll-fix-content/) to show you how to do it.
Edited to add: ... and here's another page (http://www.pixelbind.com/make-a-div-stick-when-you-scroll/) with jQuery code.
BorderTerroir
04-10-2015, 11:00 AM
Or alternatively why not go with a make then model submenu?
<li><a href="karhonda.html">Honda</a>
<ul>
<li><a href="karaccord.html">Accord</a></li>
<li><a href="karcivic.html">Civic</a></li>
<li><a href="karjazz.html">Jazz</a></li>
</ul>
</li>
theremotedr
04-10-2015, 11:06 AM
Submenu is a good idea.
Maybe not jQuery then as i think i will get lost.
Can a piece of code be added to my original to go to content.
Using this <li><a href="#content" class="scrollup">Top of page</a></li> i am taken to the item where the image will be shown no problem
BUT
In my code shown below the a= href is used hence why i asked about jQuery.
<li><a href="javascript:" onclick="replaceMainImage('m-images/photos/HONDA003.jpg', 'Honda003','<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>The Remote Doctor')">Stream remote only 2003-2006</a></li>
theremotedr
04-10-2015, 01:35 PM
Submenu added and spot on.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.