Glad you found your own solution so fast, Blake!
If you want to slide the info divs up and down using the same link,
you could also use the nice toogle function. Then you just have to do
something like this:
$(".peekaboo").each( function() {
$(this).click( function() {
va
First off, I'd like to sincerely thank both olsch01 and charlie for
their help, as well as the superb website of list member Karl
Swedberg. Between their help and that web site, I have a completely
generalized solution I am very happy with!
It was Karl's www.learningjquery.com site, and h
Agreed :)
good point, if links are sortable would need to re think my method.
Assumed they were in order in my example. If they are in order however
there is less searching of the DOM required, especially if there are
hundreds or thousands of tags
olsch01 wrote:
Hi Charlie,
one drawback of your fu
Hi Charlie,
one drawback of your function that I see is, that it only works if the
divs with the data to reveal have a simple ID count and appear in
sorted order in the code (i.e. dataToReveal1, dataToReveal2,
dataToReveal3 etc.). If you mix them up, or if you have more complex
IDs (for whatever
Hi Charlie,
one drawback of your function that I see is, that it only works if the
divs with the data to reveal appear in sorted order in the code (i.e.
dataToReveal1, dataToReveal2, dataToReveal3 etc.). If you mix them up,
the function doesn't work properly anymore (at least not in my test),
sin
Cleaner if you can use a class on the links. Assume they now have class
"dataReveal".
i=1;
$(".dataReveal").each(function () {
var actOnElem = "#dataToReveal" +i;
$(this).click( function() {
$(actOnElem).slideDown();
return false;
OK, I guess this is one possible solution:
$('a[id^=dataRevealLink]').each(function(){
var eventElemId = $(this).attr('id');
var eventElemIdNo = eventElemId.substring(14,
eventElemId.length);
var actOnElem = $('#dataToReveal' +eventElemIdNo);
Hi,
I'm not a JS/jQuery expert, so as a quick test I added alert
(actOnElem); inside your $(eventElem).click( function(), and the
result always was #dataToReveal12.
As mentioned, I am not an expert and still learning myself, but I
think on dom ready the loop simply starts running until i equals
9 matches
Mail list logo