Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Simplifying jQuery Mess

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32580
    Locke
    Participant

    Hey Everyone!

    Let me introduce my new project:

    http://7evenmgt.com

    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:

    //animate
    $('a.tal').hide();
    $('div#pdf a').addClass('book');

    $('#mb_imageflowlist').hide();
    $('.mb_heading').fadeIn(800);
    $('#mb_imagelist li:gt(11)').hide();

    $('#mb_content_wrapper').animate({
    right:'0',
    opacity: "1"
    }, 800 );
    $('#supersized-loader').fadeIn();

    $('#mb_menu a, a.showhide').bind('click', function() {
    $("#mb_content_wrapper").animate({
    top:'0',
    right:'-830px',
    opacity: "1"
    }, 800 );
    $("#supersized-loader").fadeIn();
    });

    $('#mb_imagelist li img').bind('click', function() {
    $("ul.workedIn,.single_talent,a.return").fadeOut().delay(800);
    $('ul#mb_imagelist').fadeOut(1).delay(800);
    $('a.tal').delay(2).show();
    $('#mb_imageflowlist').show().animate({
    width: '500px',
    marginLeft: '0em'
    }, 800);
    });


    $('a.tal').bind('click', function() {
    $('#mb_imageflowlist').fadeOut(1).hide();
    $('ul#mb_imagelist').delay(500).fadeIn(800);
    $('a.tal').fadeOut(100).hide();
    $("ul.workedIn,.single_talent,a.return").delay(900).fadeIn();
    $("#supersized-loader").fadeIn().fadeOut();
    });

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

    thanks!

    #47659
    DogsGhost
    Member

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

    #47355
    Locke
    Participant

    @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.

    #75889
    Locke
    Participant

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

    http://7evenmgt.com/

    thanks

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.