test
Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • Wall Crasher Developer
    #477518

    Hi seaneo,

    1. To use other image, you can change it via language detect.
    So the javascript code should be like this

    $('<a id="wbacktop" href="" class="backtotop ' + $('html').attr('lang') + '" title=""></a>').appendTo(document.body).on('click', function () {
    $('html, body').stop(true).animate({ scrollTop:0 }, 1000);
    return false;
    });

    And the add a new rule for css just after previous rule.
    .backtotop.es-es {
    background-image: url(…new image for language es-es here… )
    }

    2. To make this button only show up when user scroll at least 300px
    Just right after the block javascript code above, you should add

    $('#wbacktop').hide();
    $(window).on('scroll', function(){
    var scrolltop = $(window).scrollTop(),
    visible = $('#wbacktop').is(':visible');

    if(scrolltop >= 300 && !visible){
    $('#wbacktop').show();
    }else if(scrolltop < 300 && visible){
    $('#wbacktop').hide();
    }
    });

    Hope it helps.

    Regards

    seaneo Friend
    #477566

    Hi Wall Crasher,

    I’m getting many unexpected results, no doubt due to my lack of coding skills – maybe becuase I don’t know where and when to use closing brackets etc…

    So, for the script.js file, it should look like this? (I started copy/paste from line 516)

    if(window.jtypo.length){
    var css = document.createElement('link');
    css.type = 'text/css';
    css.rel= 'stylesheet';
    css.href= JADef.tplurl + 'css/jtypo.css';
    document.getElementsByTagName('head')[0].appendChild(css);

    $.getScript(JADef.tplurl + 'js/jtypo.js');
    }
    $('<a id="wbacktop" href="" class="backtotop ' + $('html').attr('lang') + '" title=""></a>').appendTo(document.body).on('click', function () {
    $('html, body').stop(true).animate({ scrollTop:0 }, 1000);
    return false;
    .backtotop.es-es {
    background-image: url(...new image for language es-es here... )
    }
    $('#wbacktop').hide();
    $(window).on('scroll', function(){
    var scrolltop = $(window).scrollTop(),
    visible = $('#wbacktop').is(':visible');

    if(scrolltop >= 300 && !visible){
    $('#wbacktop').show();
    }else if(scrolltop < 300 && visible){
    $('#wbacktop').hide();
    }
    });

    and then for the relative code in, template.css , it should be like this?


    .backtotop.es-es {
    background-image: url("../images/scroll-to-top-wm-es.jpg")
    }
    a.backtotop {
    position: fixed;
    bottom: 2px;
    right: 10px;
    width: 73px;
    height: 79px;
    display: block;
    background: url("../images/scroll-to-top-wm.jpg") white 0 0 no-repeat;
    z-index: 99999;
    }

    Sorry to ask for such hand holding, but I’m trying my best! thanks

    Wall Crasher Developer
    #477593

    Hi

    The block code should be like this

    if(window.jtypo.length){
    var css = document.createElement('link');
    css.type = 'text/css';
    css.rel= 'stylesheet';
    css.href= JADef.tplurl + 'css/jtypo.css';
    document.getElementsByTagName('head')[0].appendChild(css);

    $.getScript(JADef.tplurl + 'js/jtypo.js');
    }
    $('<a id="wbacktop" href="" class="backtotop ' + $('html').attr('lang') + '" title=""></a>')
    .appendTo(document.body)
    .hide()
    .on('click', function () {
    $('html, body').stop(true).animate({ scrollTop:0 }, 1000);
    return false;
    });

    $(window).on('scroll', function(){
    var scrolltop = $(window).scrollTop(),
    visible = $('#wbacktop').is(':visible');

    if(scrolltop >= 300 && !visible){
    $('#wbacktop').show();
    }else if(scrolltop < 300 && visible){
    $('#wbacktop').hide();
    }
    });

    a.backtotop {
    position: fixed;
    bottom: 2px;
    right: 10px;
    width: 73px;
    height: 79px;
    display: block;
    background: url("../images/scroll-to-top-wm.jpg") white 0 0 no-repeat;
    z-index: 99999;
    }

    .backtotop.es-es {
    background-image: url("../images/scroll-to-top-wm-es.jpg")
    }

    Hope it helps.

    Regards

    seaneo Friend
    #477711

    Hi Wall Crasher,

    thanks but after going with the above code, the effect is : http://easycaptures.com/5585687549

    …sort of a reverse staircase effect of the article previews, with no sign of the scroll buttons also.

    I am leaving it on overnight live so you can see the live site at http://173.254.15.37

    I really appreciate your ongoing help, I need to get this resolved quickly, many thanks

    Wall Crasher Developer
    #477714

    Hi seaneo,

    As I can see, you are miss a ‘});’ at the end of file.
    Please pm ftp for me to check.
    I could not login to your ftp again.

    Regards

    seaneo Friend
    #477755

    I just sent you the FTP data

    You mean in the script.js file? I see }); at the end of the file but maybe it’s not in the right spot? thanks for your quick attention to this matter!

    Wall Crasher Developer
    #477766

    Hi seaneo,

    I just updated on your site.

    Please make sure that you clear your browser cache.

    🙂

    Regards

    seaneo Friend
    #477781

    awesome!! thanks very much Wall Crasher!

    TomC Moderator
    #477782

    <em>@seaneo 352558 wrote:</em><blockquote>awesome!! thanks very much Wall Crasher!</blockquote>
    I am sorry I was not able to assist more …. and I am very glad/appreciative that my colleague, Wall Crasher, was able to successfully assist you further.

    All the best with your continuing site development …. and have a SAFE and Happy New Year celebration !!!

    seaneo Friend
    #477791

    you too Tom, many thanks

    arucardx Friend
    #477832

    Actually Tom, you were not wrong. Its just that they needed to create a footer position in index.php then publish a scroll to top module in that position. Not sure if a plugin would work, but I uses a module instead so I can control where to display it.

Viewing 11 posts - 16 through 26 (of 26 total)

This topic contains 26 replies, has 5 voices, and was last updated by  arucardx 11 years, 12 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum