JavaScript doesn't load up

Go down

In progress JavaScript doesn't load up

Post by TenzoNakamiXD on Mon 2 Dec - 15:02

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 Mon 2 Dec - 15:43

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?
avatar
Derri
Helper
Helper

Male Posts : 8712
Reputation : 628
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 Mon 2 Dec - 16:08

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 Mon 2 Dec - 16:12

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

Male Posts : 8712
Reputation : 628
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 Mon 2 Dec - 19:43

@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 Mon 2 Dec - 19:56

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?
avatar
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 Mon 2 Dec - 20:05

@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 Tue 3 Dec - 2:33

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.

avatar
SLGray
Administrator
Administrator

Male Posts : 43085
Reputation : 3049
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by erchima on Tue 3 Dec - 3:26

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
avatar
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 Tue 3 Dec - 13:10

@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 Tue 3 Dec - 21:45

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.

avatar
SLGray
Administrator
Administrator

Male Posts : 43085
Reputation : 3049
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by TenzoNakamiXD on Wed 4 Dec - 1:35

@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 Wed 4 Dec - 1:49

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.

avatar
SLGray
Administrator
Administrator

Male Posts : 43085
Reputation : 3049
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by TenzoNakamiXD on Wed 4 Dec - 10:57

@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 Thu 5 Dec - 0:42

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.

avatar
SLGray
Administrator
Administrator

Male Posts : 43085
Reputation : 3049
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by TenzoNakamiXD on Thu 5 Dec - 4:11

@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 Sat 7 Dec - 5:03

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 Sat 7 Dec - 5:09

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.

avatar
SLGray
Administrator
Administrator

Male Posts : 43085
Reputation : 3049
Language : English
Location : United States

https://fmthemes.forumotion.com/

Back to top Go down

In progress Re: JavaScript doesn't load up

Post by TenzoNakamiXD on Mon 9 Dec - 13:49

@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

Back to top


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