Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function() {
- $('.btn-6')
- .on('mouseenter', function(e) {
- var parentOffset = $(this).offset(),
- relX = e.pageX - parentOffset.left,
- relY = e.pageY - parentOffset.top;
- $(this).find('span').css({top:relY, left:relX})
- })
- .on('mouseout', function(e) {
- var parentOffset = $(this).offset(),
- relX = e.pageX - parentOffset.left,
- relY = e.pageY - parentOffset.top;
- $(this).find('span').css({top:relY, left:relX})
- });
- $('[href=#]').click(function(){return false});
- });
- var header = $('.register');
- var backgrounds = new Array(
- 'url(https://i0.wp.com/landgames.fr/wp-content/uploads/2019/04/background-habbo-6-2.png?ssl=1)'
- , 'url(https://vignette.wikia.nocookie.net/habbo-wikia/images/5/50/Wiki-background/revision/latest?cb=20140624140739&path-prefix=fr)'
- , 'url(https://puhekupla.com/images/uploads/view_1485183538_5970.png)'
- , 'url(https://i.imgur.com/J6aDQol.png)'
- );
- var current = 0;
- function nextBackground() {
- current++;
- current = current % backgrounds.length;
- header.css('background-image', backgrounds[current]);
- }
- setInterval(nextBackground, 5000);
- header.css('background-image', backgrounds[0]);
- (function($) {
- $.fn.menumaker = function(options) {
- var cssmenu = $(this), settings = $.extend({
- format: "dropdown",
- sticky: false
- }, options);
- return this.each(function() {
- $(this).find(".button").on('click', function(){
- $(this).toggleClass('menu-opened');
- var mainmenu = $(this).next('ul');
- if (mainmenu.hasClass('open')) {
- mainmenu.slideToggle().removeClass('open');
- }
- else {
- mainmenu.slideToggle().addClass('open');
- if (settings.format === "dropdown") {
- mainmenu.find('ul').show();
- }
- }
- });
- cssmenu.find('li ul').parent().addClass('has-sub');
- multiTg = function() {
- cssmenu.find(".has-sub").prepend('<span class="submenu-button"></span>');
- cssmenu.find('.submenu-button').on('click', function() {
- $(this).toggleClass('submenu-opened');
- if ($(this).siblings('ul').hasClass('open')) {
- $(this).siblings('ul').removeClass('open').slideToggle();
- }
- else {
- $(this).siblings('ul').addClass('open').slideToggle();
- }
- });
- };
- if (settings.format === 'multitoggle') multiTg();
- else cssmenu.addClass('dropdown');
- if (settings.sticky === true) cssmenu.css('position', 'fixed');
- resizeFix = function() {
- var mediasize = 1000;
- if ($( window ).width() > mediasize) {
- cssmenu.find('ul').show();
- }
- if ($(window).width() <= mediasize) {
- cssmenu.find('ul').hide().removeClass('open');
- }
- };
- resizeFix();
- return $(window).on('resize', resizeFix);
- });
- };
- })(jQuery);
- (function($){
- $(document).ready(function(){
- $("#cssmenu").menumaker({
- format: "multitoggle"
- });
- });
- })(jQuery);
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-1965499-1']);
- _gaq.push(['_trackPageview']);
- (function() {
- var ga = document.createElement('script');
- ga.type = 'text/javascript';
- ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0];
- s.parentNode.insertBefore(ga, s);
- })();
- /* Create this file and add to your js folder : vertical.news.slider.js */
- /*globals window, $, clearInterval, setInterval */
- $(function () {
- "use strict";
- var hl,
- newsList = $('.news-headlines'),
- newsListItems = $('.news-headlines li'),
- firstNewsItem = $('.news-headlines li:nth-child(1)'),
- newsPreview = $('.news-preview'),
- elCount = $('.news-headlines').children(':not(.highlight)').index(),
- vPadding = (parseInt(firstNewsItem.css('padding-top').replace('px', ''), 10)) +
- (parseInt(firstNewsItem.css('padding-bottom').replace('px', ''), 10)),
- vMargin = (parseInt(firstNewsItem.css('margin-top').replace('px', ''), 10)) +
- (parseInt(firstNewsItem.css('margin-bottom').replace('px', ''), 10)),
- cPadding = (parseInt($('.news-content').css('padding-top').replace('px', ''), 10)) +
- (parseInt($('.news-content').css('padding-bottom').replace('px', ''), 10)),
- speed = 5000, // this is the speed of the switch
- myTimer = null,
- siblings = null,
- totalHeight = null,
- indexEl = 1,
- i = null;
- // the css animation gets added dynamicallly so
- // that the news item sizes are measured correctly
- // (i.e. not in mid-animation)
- // Also, appending the highlight item to keep HTML clean
- newsList.append('<li class="highlight nh-anim"></li>');
- hl = $('.highlight');
- newsListItems.addClass('nh-anim');
- function doEqualHeight(c) {
- if (newsPreview.height() < newsList.height()) {
- newsPreview.height(newsList.height());
- } else if ((newsList.height() < newsPreview.height()) && (newsList.height() > parseInt(newsPreview.css('min-height').replace('px', ''), 10))) {
- newsPreview.height(newsList.height());
- }
- if ($('.news-content:nth-child(' + c + ')').height() > newsPreview.height()) {
- newsPreview.height($('.news-content:nth-child(' + c + ')').height() + cPadding);
- }
- }
- function doTimedSwitch() {
- myTimer = setInterval(function () {
- if (($('.selected').prev().index() + 1) === elCount) {
- firstNewsItem.trigger('click');
- } else {
- $('.selected').next(':not(.highlight)').trigger('click');
- }
- }, speed);
- }
- $('.news-content').on('mouseover', function () {
- clearInterval(myTimer);
- });
- $('.news-content').on('mouseout', function () {
- doTimedSwitch();
- });
- function doClickItem() {
- newsListItems.on('click', function () {
- newsListItems.removeClass('selected');
- $(this).addClass('selected');
- siblings = $(this).prevAll();
- totalHeight = 0;
- // this loop calculates the height of individual elements, including margins/padding
- for (i = 0; i < siblings.length; i += 1) {
- totalHeight += $(siblings[i]).height();
- totalHeight += vPadding;
- totalHeight += vMargin;
- }
- // this moves the highlight vertically the distance calculated in the previous loop
- // and also corrects the height of the highlight to match the current selection
- hl.css({
- top: totalHeight,
- height: $(this).height() + vPadding
- });
- indexEl = $(this).index() + 1;
- $('.news-content:nth-child(' + indexEl + ')').siblings().removeClass('top-content');
- $('.news-content:nth-child(' + indexEl + ')').addClass('top-content');
- clearInterval(myTimer);
- // comment out the line below if you don't
- // want it to rotate automatically
- doTimedSwitch();
- doEqualHeight(indexEl);
- });
- }
- function doWindowResize() {
- $(window).resize(function () {
- clearInterval(myTimer);
- // click is triggered to recalculate and fix the highlight position
- $('.selected').trigger('click');
- });
- }
- // this is the poor man's 'init' section
- doClickItem();
- doWindowResize();
- $('.selected').trigger('click');
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement