www.webdeveloper.com
Results 1 to 2 of 2

Thread: here's a jQuery function i'm trying to write the uses 'this'. 'This' is in an anchor

  1. #1
    Join Date
    Mar 2010
    Posts
    281

    here's a jQuery function i'm trying to write the uses 'this'. 'This' is in an anchor

    here's a simple jQuery function i'm trying to write using 'this' in the selector. 'This' is in an anchor tag and then directly next to it, i.e. the next sibling is what i'm trying to select,
    When clicking on the anchor tag ('this') the sibling div next to it should open or slideDown via jQuery.

    was thinking the plus sign in the selector should choose that div but is not working.
    am not understanding the plus sign in the selector? please know, there are several of these on the page, which is why im using this. trying to avoid function with params.

    PHP Code:
    $('.showCodeLink').click(function() {
            $(
    this '.code').slideDown('normal');
            }); 
    .showCodeLink is an anchor that would trigger the event. '.code' is the hidden div that i'm trying to open when 'showCodeLink is clicked.

    trying to access with this select $(this + '.code')

    hope that's clear, i've re-written this post 3 times!

  2. #2
    Join Date
    Feb 2003
    Location
    Michigan, USA
    Posts
    5,773

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles