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
Try putting the bulk of your code in a separate function:
$(function() {
// do check on document ready
myFunction();
// make click work
$('#Professor').click(myFunction);
});
function myFunction() {
if ( $('#Professor').get(0).checked ) {
$('#ProfessorField').show();
Cleaning that up is not Jquery's job as far as I know but the JScript
garbage collector (which basically depends on the browser). The
garbage collector is pretty smart so it shouldn't be any leak...
serious leaks used to happen only on Circular References especially in
IE6 for example, but even th
Thanks Chris and Hamish!
I ended up using the awesome LiveQuery plugin.
On Jul 7, 7:08 pm, "Chris Bailey" <[EMAIL PROTECTED]> wrote:
> Are you using the Livequery plugin to bind your events? If not, then the
> event binding, that presumably is setup in some other source file (other
> than the
Are you using the Livequery plugin to bind your events? If not, then the
event binding, that presumably is setup in some other source file (other
than the HTML that's coming in via your load), won't even run against the
new code from the AJAX load. Using Livequery will let you keep the code
separ
Possibly one of the most frequently asked questions:
http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F
On Jul 8, 1:54 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hi folks,
>
> I have a page with a photo on it. I load the comments f
I want a unified way of raising/handling events in my JavaScript
codebase. As I'm already using jQuery, it'd be nice to reuse its
smarts. :)
On Apr 2, 5:35 pm, chrismarx <[EMAIL PROTECTED]> wrote:
> interesting, for what purpose would you use this functionality?
> why not just
>
> var monkey = {n
I'd not rely on anything that is not in the docs. I suffered from
these changes in the past.
If you want a safe way to use this, you should check:
jQuery.Collection: http://flesler.blogspot.com/2008/01/jquerycollection.html
You just need to import the methods bind, unbind and trigger, and that
ca
interesting, for what purpose would you use this functionality?
why not just
var monkey = {name:'Dave',
climb:function(){alert(this.name + 'is
climbing');}
monkey.climb();
On Apr 2, 8:02 am, Thom <[EMAIL PROTECTED]> wrote:
> This works:
>
> var monkey = { name: 'Dave' }
> $(
17 matches
Mail list logo