Forums

[resolved] Solution SimpleX an Lightbox (1 post)

  1. nimo32
    Member
    Posted 3 months ago #

    A guy named David Koster found a solution: link

    Lightbox and the jQuery menu in SimpleX both use the same variable $. So the solution is to rename the variable the theme uses:

    Just edit /wp-content/themes/simplex/header.php by replacing the first by the second text mentioned below.

    $(function(){
    var tabContainers = $(’div#maintabdiv > div’);
    tabContainers.hide().filter(’#comments’).show();

    $(’div#maintabdiv ul#tabnav a’).click(function () {
    tabContainers.hide();
    tabContainers.filter(this.hash).show();
    $(’div#maintabdiv ul#tabnav a’).removeClass(’current’);
    $(this).addClass(’current’);
    return false;
    }).filter(’#comments’).click();

    });

    Rename the variable (in this example with mjq):

    mjq(function(){
    var tabContainers = mjq(’div#maintabdiv > div’);
    tabContainers.hide().filter(’#comments’).show();

    mjq(’div#maintabdiv ul#tabnav a’).click(function () {
    tabContainers.hide();
    tabContainers.filter(this.hash).show();
    mjq(’div#maintabdiv ul#tabnav a’).removeClass(’current’);
    mjq(this).addClass(’current’);
    return false;
    }).filter(’#comments’).click();

    });

    The only thing left to do is telling the jQuery SimpleX uses to not look for $ but for mjq. Therefore edit /wp-content/themes/simplex/js/jquery-1.2.6.min.js (or similar) replace the following:

    var _jQuery=window.jQuery,_$=window.$;
    becomes: var _jQuery=window.jQuery,_mjq=window.mjq;

    var jQuery=window.jQuery=window.$=function(selector,context)
    becomes: var jQuery=window.jQuery=window.mjq=function(selector,context)

    window.$=_$;
    becomes: window.mjq=_mjq;

Reply

You must log in to post.

About this Topic