Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: How to fire click event of an LI tag?

  1. #11
    Join Date
    Apr 2012
    Posts
    85
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Dear Jscheuer1,

    Thank you for your reply Jscheuer1.
    I did the things same as you have written and yes also put that script at the end of page.

    But still it is not working. At the time of starting this thread (means starting from the first post) I put the following thing (that is commented now & applied your suggestion that is jQuery('li.cat-item-8').trigger('click'); ) :-

    Code:
    <?php
    if($_POST['page']!='') // this means logo design. I am getting no problem with that
    {
    ?>
    <script>
        /*function lightboxPhoto123() {
    	jQuery("a[rel^='prettyPhoto']").prettyPhoto({
    			animationSpeed:'fast',
    			slideshow:5000,
    			theme:'facebook',
    			show_title:false,
    			overlay_gallery: true
    		});
    	
    	}*/
        jQuery('li.cat-item-8').trigger('click');
    </script>
    <script type="text/javascript">
        /*var s = jQuery.noConflict();
        
        // Clone applications to get a second collection
        var $data123 = s(".portfolio-area").clone();
            
        s(".filter li").removeClass("active");	
        // Use the last category class as the category to filter by. This means that multiple categories are not supported (yet)
        //var filterClass=$(this).attr('class').split(' ').slice(-1)[0];
        
        var filterClass123 = "cat-item-8";
        
        if (filterClass123 == 'all') {
                var $filteredData123 = $data123.find('.portfolio-item2');
        } else {
                var $filteredData123 = $data123.find('.portfolio-item2[data-type=' + filterClass123 + ']');
        }
        
        //alert($filteredData);
        
        s(".portfolio-area").quicksand($filteredData123, {
                duration: 600,
                adjustHeight: 'auto'
        }, function () {lightboxPhoto123();});		
        s(this).addClass("active");		
        */
    </script>
    <?php
    }
    ?>
    You can see script.js for why I put that code which is commented now.
    I think that will help.

    Thanks
    Kaushal

  2. #12
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,370
    Thanks
    77
    Thanked 3,421 Times in 3,382 Posts
    Blog Entries
    12

    Default

    This:

    Code:
    jQuery('li.cat-item-8').trigger('click');
    should be:

    Code:
    jQuery(window).load(function(){
        jQuery('li.cat-item-8').trigger('click');
    });
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #13
    Join Date
    Apr 2012
    Posts
    85
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    My God..........Jscheuer1 you are simply the superb, man.

    Thank you...........Thank you very very much

    It is working fine now.

    Thanks
    Kaushal

Similar Threads

  1. [HELP] Click event inside javascript
    By 4rum25 in forum JavaScript
    Replies: 0
    Last Post: 09-14-2010, 07:51 AM
  2. Replies: 1
    Last Post: 04-03-2010, 11:21 PM
  3. MooTools: Problem with click event.
    By JBottero in forum JavaScript
    Replies: 2
    Last Post: 08-31-2009, 12:28 PM
  4. how to force fire the onChange event
    By rizlaa in forum JavaScript
    Replies: 5
    Last Post: 03-15-2009, 10:54 PM
  5. click event for <select> <option>
    By HockeyFan in forum HTML
    Replies: 4
    Last Post: 09-17-2005, 04:57 PM

Tags for this Thread

Bookmarks

Posting Permissions

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