The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

JavaScript doesn't load up

View previous topic View next topic Go down

In progress JavaScript doesn't load up

Post by TenzoNakamiXD on December 2nd 2013, 2:02 pm

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.


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);
}
// ]]>

TenzoNakamiXD
Forumember

Posts : 113
Reputation : 1
Language : English, Indonesian

http://mhulz-team.forumq.net

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by Derri on December 2nd 2013, 2:43 pm

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?


Forum Rules : : Forumotion Staff : : Appeal A Warning : : FAQ : : Tips & Tricks : : Forgotten Password/Login Issues
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


Derri
Administrator
Administrator

Male Posts : 8355
Reputation : 571
Language : English & Basic French
Location : Scotland, United Kingdom

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by TenzoNakamiXD on December 2nd 2013, 3:08 pm

It actually submit without any error,
but it doesnt show the visual effect that i want..

TenzoNakamiXD
Forumember

Posts : 113
Reputation : 1
Language : English, Indonesian

http://mhulz-team.forumq.net

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by Derri on December 2nd 2013, 3:12 pm

Can you provide a link to where you got the Javascript forum.


Forum Rules : : Forumotion Staff : : Appeal A Warning : : FAQ : : Tips & Tricks : : Forgotten Password/Login Issues
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


Derri
Administrator
Administrator

Male Posts : 8355
Reputation : 571
Language : English & Basic French
Location : Scotland, United Kingdom

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by TenzoNakamiXD on December 2nd 2013, 6:43 pm

@Derri wrote:Can you provide a link to where you got the Javascript forum.
Sorry, i cant understand what you are trying to say to me bwi

TenzoNakamiXD
Forumember

Posts : 113
Reputation : 1
Language : English, Indonesian

http://mhulz-team.forumq.net

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by Ultron's Vision on December 2nd 2013, 6:56 pm

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?

Ultron's Vision
Forumember

Male Posts : 634
Reputation : 45
Language : English | German | HTML | JavaScript | PHP | C++ | Perl | Java
Location : Vienna, Austria

http://duelacademy.net

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by TenzoNakamiXD on December 2nd 2013, 7:05 pm

@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?
Ahh, i got it.
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.

TenzoNakamiXD
Forumember

Posts : 113
Reputation : 1
Language : English, Indonesian

http://mhulz-team.forumq.net

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by SLGray on December 3rd 2013, 1:33 am

If you want falling snow, you could check out this - http://help.forumotion.com/t128443-christmas-new-year-decorations .

Do you have JavaScript Management activated?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35613
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by erchima on December 3rd 2013, 2:26 am

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
Code:

<scriptsrc="URL YOUR FORUM/javascript ID.js" type="text/javascript"></script>
example:
Code:

<scriptsrc="http://urlyourforum.com/12345.js" type="text/javascript"></script>
put code to widget

erchima
Forumember

Female Posts : 629
Reputation : 15
Language : INDONESIAN | Lua Script | Visual Basic | and Coding
Location : Under your bed xD

http://erchimacute.forumid.net

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by TenzoNakamiXD on December 3rd 2013, 12:10 pm

@SLGray wrote:If you want falling snow, you could check out this - http://help.forumotion.com/t128443-christmas-new-year-decorations .

Do you have JavaScript Management activated?
Sorry, i cant make sure if it is activated or not. (idk where to check that out.) Help perhaps?

@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 slot
Code:

<scriptsrc="URL YOUR FORUM/javascript ID.js" type="text/javascript"></script>
example:
Code:

<scriptsrc="http://urlyourforum.com/12345.js" type="text/javascript"></script>
put code to widget
Let me try.
EDIT: Sorry, not working.

TenzoNakamiXD
Forumember

Posts : 113
Reputation : 1
Language : English, Indonesian

http://mhulz-team.forumq.net

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by SLGray on December 3rd 2013, 8:45 pm

Administration Panel > Modules > HMTL/JavaSCript
JavaScript Managements
Above the list of JavaScripts there should be the on and off option.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35613
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by TenzoNakamiXD on December 4th 2013, 12:35 am

@SLGray wrote:Administration Panel > Modules > HMTL/JavaSCript
JavaScript Managements
Above the list of JavaScripts there should be the on and off option.
Enabled since the first time, but still not showing up the effect i want to.

TenzoNakamiXD
Forumember

Posts : 113
Reputation : 1
Language : English, Indonesian

http://mhulz-team.forumq.net

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by SLGray on December 4th 2013, 12:49 am

Try this:

Add the JavaScript code to an announcement that is on all pages.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35613
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by TenzoNakamiXD on December 4th 2013, 9:57 am

@SLGray wrote:Try this:

Add the JavaScript code to an announcement that is on all pages.
Ahh, that works.
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.

TenzoNakamiXD
Forumember

Posts : 113
Reputation : 1
Language : English, Indonesian

http://mhulz-team.forumq.net

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by SLGray on December 4th 2013, 11:42 pm

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.


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35613
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by TenzoNakamiXD on December 5th 2013, 3:11 am

@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.
Yes,
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.

TenzoNakamiXD
Forumember

Posts : 113
Reputation : 1
Language : English, Indonesian

http://mhulz-team.forumq.net

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by TenzoNakamiXD on December 7th 2013, 4:03 am

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:

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;}}

TenzoNakamiXD
Forumember

Posts : 113
Reputation : 1
Language : English, Indonesian

http://mhulz-team.forumq.net

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by SLGray on December 7th 2013, 4:09 am

What part of the CSS is for the code?


When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.


SLGray
Administrator
Administrator

Male Posts : 35613
Reputation : 2372
Language : English
Location : United States

http://fmthemes.forumotion.com/

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by TenzoNakamiXD on December 9th 2013, 12:49 pm

@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  bwi )

TenzoNakamiXD
Forumember

Posts : 113
Reputation : 1
Language : English, Indonesian

http://mhulz-team.forumq.net

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum