ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Need some jQuery/website help. Im stuck.



mas

  MK7 GTD & Mini GP
I have just finished completing the new website for our Estate Agency and it has gone live today... hoorah! It took long enough :quiet:

http://www.ashtons-online.co.uk/

However I need some help with jQuery, basically I have search functions which utilise a predictive search field. When you type a letter, it predicts certain areas which we cover as an agency and if you are scrolled a little down the page and use the function, when you click an area, the browser jumps back to the top of the page. I have done a search on the web but can't seem to find a way to fix the issue, its rather annoying.

An example would be to use this page...

http://www.ashtons-online.co.uk/sales/buying/buying-home.html

Scroll down a little, and begin to type in the area field. Use 'Wa' and select Warrington from the options.... agghhhh the jump!!!

Any ideas on what can be done to fix this? I'm guessing its because there is link which doesn't physically point to anything.

Cheers
 
  Ibiza FR
Cant really tell you the best solution without seeing the current code, but if there is a click event on the links in the dropdown that looks something like below;
$('.dropdownlink').click(function(){
// do your function
});

Then just add in 2 little things so it looks like this (e in the brackets and the 1 line of code before your function.
$('.dropdownlink').click(function(e){
e.preventDefault();
// do your function
});

This will stop the browser doing what a link would normally do (go to the href of that link);

Pretty sure that should sort it. If your code doesn't look like the above, post it and I will have another look.
 

mas

  MK7 GTD & Mini GP
Hi Mate,

Thanks for that, will take a look when I'm back home tonight. I think your explanation should fix it.

Sam
 


Top