Editing A Snow Javascript
2 posters
Page 1 of 1
Editing A Snow Javascript
Original Script: http://js01.fra.co/21268.js
I want to know what I could do to make the snowflakes extent further down the page before "melting." Thanks in advance.
- Code:
var intervalId;(function($){$.fn.snowFall=function(options){var settings={"color":"#eee","interval":10,"total":20};if(options){$.extend(settings,options)}function init(number){if(temp.currTotal<=settings.total){for(i=0;i<number;i++){var obj=$("<div class='snow'>*</div>");obj.css("color",settings.color);obj.css("position","absolute");obj.css("opacity","0.9");var rand=Math.random()*15+8;obj.css("font-size",rand);obj.css("top",0);var random=Math.floor(Math.random()*$(window).width()-5);obj.css("left",random);obj.data("direction",Math.floor(Math.random()*3)-1);obj.data("speed",Math.floor(Math.random()*2)+1);obj.data("iter",0);$("body").append(obj);temp.currTotal++}}}var temp={};temp.currTotal=0;init(5);setInterval(function(){$(".snow").each(function(){var speed=$(this).data("speed");var iter=$(this).data("iter");var dirn=$(this).data("direction");$(this).data("iter",iter+1);if(speed==iter){$(this).data("iter",0);var p=$(this).position();if(p.top+40<$(window).height()){$(this).css("top",p.top+1)}else{$(this).remove();temp.currTotal--;return 0}if(p.left+20<$(document).width()&&p.left>0){$(this).css("left",p.left+dirn)}else{$(this).remove();temp.currTotal--;return 0}}})},settings.interval);intervalId=setInterval(function(){init(1)},1E3)};$.fn.stopFall=function(){clearInterval(intervalId)}})(jQuery);$('body').snowFall({color:'#fff',interval:'6',total:'20'});
I want to know what I could do to make the snowflakes extent further down the page before "melting." Thanks in advance.
Re: Editing A Snow Javascript
Hi,
Please, read this thread: https://help.forumotion.com/t144563-
You just need to edit this:
Window height is the user window. Page height it'll go to the bottom of your forum -- doesn't matter if the user's screen small or not.
Regards.
Please, read this thread: https://help.forumotion.com/t144563-
You just need to edit this:
- Code:
/ / Distance the snow will go on your page ("windowheight"ou "PageHeight")
var snowdistance = "pageheight";
Window height is the user window. Page height it'll go to the bottom of your forum -- doesn't matter if the user's screen small or not.
Regards.
Re: Editing A Snow Javascript
Hi,
It'll work in your entire forum, normally. The only difference is that, instead of making a singular JS code, you'll have to host that script in a HTML page. But it'll work everywhere.
Regards.
It'll work in your entire forum, normally. The only difference is that, instead of making a singular JS code, you'll have to host that script in a HTML page. But it'll work everywhere.
Regards.
Re: Editing A Snow Javascript
I only want it to work in forums and sub forums. IS there a way to set that as well?
Re: Editing A Snow Javascript
Yes. Instead of applying this "JS" in all pages (<script src="URLOFTHEHTMLPAGEHERE"></script>), make it work in the topics or whatever area you wish.
Regards.
Regards.
Re: Editing A Snow Javascript
I added it, though I does not seem to work.
I'm using it on : http://wondertale.forumotion.com/
The script URL : http://wondertale.forumotion.com/h1-snow
JS Code:
I'm using it on : http://wondertale.forumotion.com/
The script URL : http://wondertale.forumotion.com/h1-snow
JS Code:
- Code:
<script src="http://wondertale.forumotion.com/h1-snow"></script>
Re: Editing A Snow Javascript
Hi,
Okay. Instead of using it (<script src="http://wondertale.forumotion.com/h1-snow"></script>) in a JS page, use it in in the beginning of your Forum Description. It should work now.
Regards.
Okay. Instead of using it (<script src="http://wondertale.forumotion.com/h1-snow"></script>) in a JS page, use it in in the beginning of your Forum Description. It should work now.
Regards.
Re: Editing A Snow Javascript
ACP > Display > Homepage > Generalities > Homepage message >
ACP > General > Forum > Configuration > Site description
The above doesn't work,
ACP > General > Forum > Configuration > Site description
The above doesn't work,
Re: Editing A Snow Javascript
Hi,
Sorry for the late reply. It looks like that the code I provided you has been discontinued.
So, I edited the first script to go to the bottom of your HTML page.
See if that works.
Regards.
Sorry for the late reply. It looks like that the code I provided you has been discontinued.
So, I edited the first script to go to the bottom of your HTML page.
- Code:
var intervalId;(function($){$.fn.snowFall=function(options){var settings={"color":"#eee","interval":10,"total":20};if(options){$.extend(settings,options)}function init(number){if(temp.currTotal<=settings.total){for(i=0;i<number;i++){var obj=$("<div class='snow'>*</div>");obj.css("color",settings.color);obj.css("position","absolute");obj.css("opacity","0.9");var rand=Math.random()*15+8;obj.css("font-size",rand);obj.css("top",0);var random=Math.floor(Math.random()*$(window).width()-5);obj.css("left",random);obj.data("direction",Math.floor(Math.random()*3)-1);obj.data("speed",Math.floor(Math.random()*2)+1);obj.data("iter",0);$("body").append(obj);temp.currTotal++}}}var temp={};temp.currTotal=0;init(5);setInterval(function(){$(".snow").each(function(){var speed=$(this).data("speed");var iter=$(this).data("iter");var dirn=$(this).data("direction");$(this).data("iter",iter+1);if(speed==iter){$(this).data("iter",0);var p=$(this).position();if(p.top+40<$(document).height()){$(this).css("top",p.top+1)}else{$(this).remove();temp.currTotal--;return 0}if(p.left+20<$(document).width()&&p.left>0){$(this).css("left",p.left+dirn)}else{$(this).remove();temp.currTotal--;return 0}}})},settings.interval);intervalId=setInterval(function(){init(1)},1E3)};$.fn.stopFall=function(){clearInterval(intervalId)}})(jQuery);$('body').snowFall({color:'#fff',interval:'6',total:'20'});
See if that works.
Regards.
Similar topics
» Editing post colors via Javascript - Won't work now
» Can i got CSS something like snow ..
» add snow
» about the snow effects
» Please help (snow on the forum)
» Can i got CSS something like snow ..
» add snow
» about the snow effects
» Please help (snow on the forum)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum