![]() |
Having problems scrolling to 'Y' position
I have not been having luck with jQuery lately.
All I am trying to do is find a specific span tag (which i did) and then find its position in the parent div and scroll to that point. The alerts below simply return '0'. Code:
var elemnt = $('#glossaryContent').find('span:contains(' + evt + ')'); |
I didn't know there was a CSS pseudo class :contains, and as I search the w3c reference this has already been deprecated.
Nevertheless jQuery implements it and so perhaps your line should be something like below, or the reverse (flip the double-quotes with the singles): Code:
.find('span:contains("' + evt + '")') |
Quote:
|
Is it possible the span just doesn't contain the exact 'evt' term? Maybe some letters are in uppercase. Could you paste a bit of the HTML structure here?
|
Quote:
Code:
<a class="glossaryLink" href="#" onmouseover="onRollOverPULink(event, 'GSU');"onmouseout="onRollOutPULink(event);" onclick="showHideGlossary('GSU')">GSU</a>Code:
$("#glossaryContent").append("<span class='glossAcro'>" + $(this).attr('term') + "</span>" + "<span class='glossDef'>" + $(this).attr('def') + "</span>"); // output from XMLCode:
<item term="GIG" def="Global Information Grid" /> |
| All times are GMT +1. The time now is 11:56 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.