Difference between revisions of "Team:Vilnius-Lithuania/Vilnius15 Script"

 
(30 intermediate revisions by the same user not shown)
Line 4: Line 4:
  
 
     $("#footer-box").prepend($("#social-footer"));
 
     $("#footer-box").prepend($("#social-footer"));
 +
 +
function gotop(e){
 +
  if ($(window).scrollTop() != 0) {
 +
    $("a#gotop").fadeIn(400);
 +
  } else {
 +
    $("a#gotop").fadeOut(400);
 +
  }
 +
}
 +
 +
 +
$(window).load(function () {
 +
    $('head').append('<link rel="icon" type="image/png" href="http://www.example.com/image.png">');
 +
  });
 +
$(window).load(function () {
 +
    $('head').append('<link rel="shortcut icon" href="http://s6.postimg.org/5e5zj2w31/favicon.png" />');
 +
  });
 +
 +
$("a#gotop").hide(0);
 +
gotop();
 +
 +
$(window).scroll(gotop);
 +
$("a#gotop").click(function(e){
 +
  e.preventDefault();
 +
  $(window).off('scroll', gotop);
 +
  $('html, body').animate({scrollTop : 0},500,'swing',function(){$(window).scroll(gotop);$("a#gotop").fadeOut(400);});
 +
});
 +
 +
  
  
Line 14: Line 42:
 
         captions: true
 
         captions: true
 
     });
 
     });
 +
 +
$("div.thumbinner > a img").slimbox({}, function(el) {
 +
url = el.src;
 +
if (url.indexOf('thumb') != -1) {
 +
url = url.substring(0, url.lastIndexOf('/'));
 +
url = url.replace('/thumb/', '/');
 +
}
 +
description = $(el).parents("div.thumbinner").children("div.thumbcaption").text();
 +
return [url, description];
 +
}, function(el) {
 +
return (this == el);
 +
});
  
 
     $('.bxgallery').bxSlider({
 
     $('.bxgallery').bxSlider({
Line 24: Line 64:
 
     });
 
     });
  
// Lightbox
 
 
    $("div.thumbinner > a img").slimbox({}, function (el) {
 
        url = el.src;
 
        if (url.indexOf('thumb') != -1) {
 
            url = url.substring(0, url.lastIndexOf('/'));
 
            url = url.replace('/thumb/', '/');
 
        }
 
        description = $(el).parents("div.thumbinner").children("div.thumbcaption").text();
 
        return [url, description];
 
    }, function (el) {
 
        return (this == el);
 
    });
 
 
    $("ul.bxgallery img").slimbox({loop: true}, function (el) {
 
        url = el.src;
 
        if (url.indexOf('thumb') != -1) {
 
            url = url.substring(0, url.lastIndexOf('/'));
 
            url = url.replace('/thumb/', '/');
 
        }
 
        description = el.title + el.alt;
 
        return [url, description];
 
    }, function (el) {
 
        return (this == el) || (this.parentNode.parentNode && (this.parentNode.parentNode == el.parentNode.parentNode));
 
    });
 
  
  

Latest revision as of 01:47, 15 September 2015

function myWikiReady() {

// put the footer in the right place

   $("#footer-box").prepend($("#social-footer"));

function gotop(e){

 if ($(window).scrollTop() != 0) {
   $("a#gotop").fadeIn(400);
 } else {
   $("a#gotop").fadeOut(400);
 }

}


$(window).load(function () {

   $('head').append('<link rel="icon" type="image/png" href="http://www.example.com/image.png">');
 });

$(window).load(function () {

   $('head').append('<link rel="shortcut icon" href="http://s6.postimg.org/5e5zj2w31/favicon.png" />');
 });

$("a#gotop").hide(0); gotop();

$(window).scroll(gotop); $("a#gotop").click(function(e){

 e.preventDefault();
 $(window).off('scroll', gotop);
 $('html, body').animate({scrollTop : 0},500,'swing',function(){$(window).scroll(gotop);$("a#gotop").fadeOut(400);});

});



// Slideshows

   $('.bxslider').bxSlider({
       responsive: false,
       auto: true,
       autoHover: true,
       captions: true
   });

$("div.thumbinner > a img").slimbox({}, function(el) { url = el.src; if (url.indexOf('thumb') != -1) { url = url.substring(0, url.lastIndexOf('/')); url = url.replace('/thumb/', '/'); } description = $(el).parents("div.thumbinner").children("div.thumbcaption").text(); return [url, description]; }, function(el) { return (this == el); });

   $('.bxgallery').bxSlider({
       captions: true,
       slideMargin: 10,
       minSlides: 3,
       maxSlides: 3,
       moveSlides: 1,
       slideWidth: 5000
   });


}

$(document).ready(myWikiReady);