Treehouse: Grow your CSS skills. Land your dream job.

Simplifying jQuery Mess

  • # May 3, 2011 at 12:35 pm

    Hey Everyone!

    Let me introduce my new project:

    I use some jquery code to make it look better , the code works really well, but I think I use to much lines to make it work…

    I’m not the expert on jQuery in fact I use what is logic to me … but I know there must be rules to make it better..

    this is the code I use:

    $('div#pdf a').addClass('book');

    $('#mb_imagelist li:gt(11)').hide();

    opacity: "1"
    }, 800 );

    $('#mb_menu a, a.showhide').bind('click', function() {
    opacity: "1"
    }, 800 );

    $('#mb_imagelist li img').bind('click', function() {
    width: '500px',
    marginLeft: '0em'
    }, 800);

    $('a.tal').bind('click', function() {

    if somebody could give me a lesson or maybe point me in the correct way , I will appreciate it very much.


    # May 3, 2011 at 2:10 pm

    .bind('click', function() { can just be written as .click(function() {

    # May 4, 2011 at 5:13 pm

    @DogsGhost oh yeah you’re sooo right. , In fact I don’t really know why I use .blind , was inertial I think so haha, thanks for the tip.

    # May 17, 2011 at 2:12 am

    well poject is open ,if someone want can give some feedback, (btw the jquery is still a mess).


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.