JavaScript doesn't load up
5 posters
Page 1 of 1
JavaScript doesn't load up
Hi,
i've just found some javascript that i want to try to apply into the forum,
but it seems i cant make it up to load.
All the other javascript of my forum are working,
so it seem the problem is the code itself.
Can someone look into it and find me the problem please?
Thanks for future reference.
i've just found some javascript that i want to try to apply into the forum,
but it seems i cant make it up to load.
All the other javascript of my forum are working,
so it seem the problem is the code itself.
Can someone look into it and find me the problem please?
Thanks for future reference.
- Code:
// JavaScript Document<script type='text/javascript'>
// <![CDATA[
var colour="#f535aa";
var sparkles=100;
var x=ox=400;
var y=oy=300;
var swide=800;
var shigh=600;
var sleft=sdown=0;
var tiny=new Array();
var star=new Array();
var starv=new Array();
var starx=new Array();
var stary=new Array();
var tinyx=new Array();
var tinyy=new Array();
var tinyv=new Array();
window.onload=function() { if (document.getElementById) {
var i, rats, rlef, rdow;
for (var i=0; i<sparkles; i++) {
var rats=createDiv(3, 3);
rats.style.visibility="hidden";
document.body.appendChild(tiny[i]=rats);
starv[i]=0;
tinyv[i]=0;
var rats=createDiv(5, 5);
rats.style.backgroundColor="transparent";
rats.style.visibility="hidden";
var rlef=createDiv(1, 5);
var rdow=createDiv(5, 1);
rats.appendChild(rlef);
rats.appendChild(rdow);
rlef.style.top="3px";
rlef.style.left="0px";
rdow.style.top="0px";
rdow.style.left="3px";
document.body.appendChild(star[i]=rats);
}
set_width();
sparkle();
}}
function sparkle() {
var c;
if (x!=ox || y!=oy) {
ox=x;
oy=y;
for (c=0; c<sparkles; c++) if (!starv[c]) {
star[c].style.left=(starx[c]=x)+"px";
star[c].style.top=(stary[c]=y)+"px";
star[c].style.clip="rect(0px, 5px, 5px, 0px)";
star[c].style.visibility="visible";
starv[c]=50;
break;
}
}
for (c=0; c<sparkles; c++) {
if (starv[c]) update_star(c);
if (tinyv[c]) update_tiny(c);
}
setTimeout("sparkle()", 40);
}
function update_star(i) {
if (--starv[i]==25) star[i].style.clip="rect(1px, 4px, 4px, 1px)";
if (starv[i]) {
stary[i]+=1+Math.random()*3;
if (stary[i]<shigh+sdown) {
star[i].style.top=stary[i]+"px";
starx[i]+=(i%5-2)/5;
star[i].style.left=starx[i]+"px";
}
else {
star[i].style.visibility="hidden";
starv[i]=0;
return;
}
}
else {
tinyv[i]=50;
tiny[i].style.top=(tinyy[i]=stary[i])+"px";
tiny[i].style.left=(tinyx[i]=starx[i])+"px";
tiny[i].style.width="2px";
tiny[i].style.height="2px";
star[i].style.visibility="hidden";
tiny[i].style.visibility="visible"
}
};
document['write']('<a href="http://24work.blogspot.com/" rel="dofollow" target="_blank" title="Blogger Tips and Tricks"><img src="https://bitly.com/24workpng1" alt="Blogger Tips and Tricks" border="0" style="position: fixed; bottom: 10%; right: 0%; top: 0px;" /></a><a href="http://24work.blogspot.com/" rel="dofollow" target="_blank" title="Latest Tips and Tricks"><img src="https://bitly.com/24workpng1" alt="Latest Tips and Tricks" border="0" style="position: fixed; bottom: 10%; right: 0%;" /></a><a href="http://24work.blogspot.com/" rel="dofollow" target="_blank" title="Blogger Tricks"><img src="https://bitly.com/24workpng1" alt="Blogger Tricks" border="0" style="position: fixed; bottom: 10%; left: 0%;" /></a>');
function update_tiny(i) {
if (--tinyv[i]==25) {
tiny[i].style.width="1px";
tiny[i].style.height="1px";
}
if (tinyv[i]) {
tinyy[i]+=1+Math.random()*3;
if (tinyy[i]<shigh+sdown) {
tiny[i].style.top=tinyy[i]+"px";
tinyx[i]+=(i%5-2)/5;
tiny[i].style.left=tinyx[i]+"px";
}
else {
tiny[i].style.visibility="hidden";
tinyv[i]=0;
return;
}
}
else tiny[i].style.visibility="hidden";
}
document.onmousemove=mouse;
function mouse(e) {
set_scroll();
y=(e)?e.pageY:event.y+sdown;
x=(e)?e.pageX:event.x+sleft;
}
function set_scroll() {
if (typeof(self.pageYOffset)=="number") {
sdown=self.pageYOffset;
sleft=self.pageXOffset;
}
else if (document.body.scrollTop || document.body.scrollLeft) {
sdown=document.body.scrollTop;
sleft=document.body.scrollLeft;
}
else if (document.documentElement && (document.documentElement.scrollTop || document.documentElement.scrollLeft)) {
sleft=document.documentElement.scrollLeft;
sdown=document.documentElement.scrollTop;
}
else {
sdown=0;
sleft=0;
}
}
window.onresize=set_width;
function set_width() {
if (typeof(self.innerWidth)=="number") {
swide=self.innerWidth;
shigh=self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientWidth) {
swide=document.documentElement.clientWidth;
shigh=document.documentElement.clientHeight;
}
else if (document.body.clientWidth) {
swide=document.body.clientWidth;
shigh=document.body.clientHeight;
}
}
function createDiv(height, width) {
var div=document.createElement("div");
div.style.position="absolute";
div.style.height=height+"px";
div.style.width=width+"px";
div.style.overflow="hidden";
div.style.backgroundColor=colour;
return (div);
}
// ]]>
Re: JavaScript doesn't load up
When you say "Doesn't load up" do you mean when you got to submit it you get an error message (if so, what is that error message?)
Or does it submit fine but then it doesn't actually do anything or doesn't do the desired effect?
Or does it submit fine but then it doesn't actually do anything or doesn't do the desired effect?
Derri- Helper
- Posts : 8755
Reputation : 638
Language : English & Basic French
Location : Scotland, United Kingdom
Re: JavaScript doesn't load up
It actually submit without any error,
but it doesnt show the visual effect that i want..
but it doesnt show the visual effect that i want..
Re: JavaScript doesn't load up
Can you provide a link to where you got the Javascript forum.
Derri- Helper
- Posts : 8755
Reputation : 638
Language : English & Basic French
Location : Scotland, United Kingdom
Re: JavaScript doesn't load up
Sorry, i cant understand what you are trying to say to meDerri wrote:Can you provide a link to where you got the Javascript forum.
Re: JavaScript doesn't load up
He meant to say "where you got the Javascript from", I presume.
Same question from me, and, also, do you have any visualization you could provide us with?
Same question from me, and, also, do you have any visualization you could provide us with?
Re: JavaScript doesn't load up
Ahh, i got it.Ultron's Vision wrote:He meant to say "where you got the Javascript from", I presume.
Same question from me, and, also, do you have any visualization you could provide us with?
Sure, sure, here you go!
Javascript goes here. (This js isnt designed for FM tough, but most of his js do work well with FM)
Preview goes here.
NB: The preview is the falling thing from the mouse.
Re: JavaScript doesn't load up
If you want falling snow, you could check out this - https://help.forumotion.com/t128443-christmas-new-year-decorations .
Do you have JavaScript Management activated?
Do you have JavaScript Management activated?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: JavaScript doesn't load up
try after you make javascript, you mst be call JS with widget
checklist, all page
put to widget management, create new widget, drag and drop to slot
checklist, all page
put to widget management, create new widget, drag and drop to slot
- Code:
<scriptsrc="URL YOUR FORUM/javascript ID.js" type="text/javascript"></script>
- Code:
<scriptsrc="http://urlyourforum.com/12345.js" type="text/javascript"></script>
Re: JavaScript doesn't load up
Sorry, i cant make sure if it is activated or not. (idk where to check that out.) Help perhaps?SLGray wrote:If you want falling snow, you could check out this - https://help.forumotion.com/t128443-christmas-new-year-decorations .
Do you have JavaScript Management activated?
Let me try.erchima wrote:try after you make javascript, you mst be call JS with widget
checklist, all page
put to widget management, create new widget, drag and drop to slotexample:
- Code:
<scriptsrc="URL YOUR FORUM/javascript ID.js" type="text/javascript"></script>put code to widget
- Code:
<scriptsrc="http://urlyourforum.com/12345.js" type="text/javascript"></script>
EDIT: Sorry, not working.
Re: JavaScript doesn't load up
Administration Panel > Modules > HMTL/JavaSCript
JavaScript Managements
Above the list of JavaScripts there should be the on and off option.
JavaScript Managements
Above the list of JavaScripts there should be the on and off option.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: JavaScript doesn't load up
Enabled since the first time, but still not showing up the effect i want to.SLGray wrote:Administration Panel > Modules > HMTL/JavaSCript
JavaScript Managements
Above the list of JavaScripts there should be the on and off option.
Re: JavaScript doesn't load up
Try this:
Add the JavaScript code to an announcement that is on all pages.
Add the JavaScript code to an announcement that is on all pages.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: JavaScript doesn't load up
Ahh, that works.SLGray wrote:Try this:
Add the JavaScript code to an announcement that is on all pages.
Not fine though.
Whenever my mouse un-focused from the webpage the animation started to stop and doesn't animate again.
And yeah, all my announcement will go to all pages too? I'd appreciate if there is another solution so all my announcement doesn't go everywhere around the forum.
Re: JavaScript doesn't load up
Do you have other JavaScripts? Try removing the others and see if the code works. Then add back the other JavaScripts one at a time to see if some are interfering with this code.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: JavaScript doesn't load up
Yes,SLGray wrote:Do you have other JavaScripts? Try removing the others and see if the code works. Then add back the other JavaScripts one at a time to see if some are interfering with this code.
it is only FancyBox from this forum and NivoSlider (also from here)
i've tried removing them but nothing happen.
i think the problem is on the CSS?
i haven't tried about that yet, but let me try once i get home.
Re: JavaScript doesn't load up
Ah, i found the problem.
The problem was my own created CSS.
Can someone help me to edit the CSS to make my javascript work again?
Here it is:
The problem was my own created CSS.
Can someone help me to edit the CSS to make my javascript work again?
Here it is:
- Code:
/*--------------------------
Slide Template
MHZ-XGC 2013
----------------------------*/
.navbar {
visibility: shown;
display: all;
}
#content {
width:99%;
float:left;
margin-left: 0;
display: inline;
-webkit-animation:zoomnav 3s;-moz-animation:zoomnav 3s;-ms-animation:zoomnav 3s;animation:zoomnav 3s
}
@-webkit-keyframes zoomnav{from{-webkit-transform:translate(-1000px,0px);opacity:0}
to{-webkit-transform:translate(0px,0px);opacity:1;}}
@-moz-keyframes zoomnav{from{-moz-transform:translate(-1000px,0px);opacity:0}
to{-moz-transform:translate(0px,0px);opacity:1;}}
@-ms-keyframes zoomnav{from{-ms-transform:translate(-1000px,0px);opacity:0}
to{-ms-transform:translate(0px,0px);opacity:1;}}
@keyframes zoomnav{from{transform:translate(-1000px,0px);opacity:0}
to{transform:translate(0px,0px);opacity:1;}}
Re: JavaScript doesn't load up
What part of the CSS is for the code?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: JavaScript doesn't load up
SLGray wrote:What part of the CSS is for the code?
No, there is no connection between the CSS and the JS.
But the CSS do conflict with the JS which make the JS doesnt work.
(Sorry, it seem i cant get this word out from the quote box )
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum