Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-07-2012, 08:56 PM   PM User | #1
JeremyJohn
New to the CF scene

 
Join Date: Nov 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
JeremyJohn is an unknown quantity at this point
Post activate spin.js jquery plugin from javascript

Hi guys, how do i activate this:

Code:
$(window).load(function spinner(){
var opts = {
  lines: 10, // The number of lines to draw
  length: 7, // The length of each line
  width: 4, // The line thickness
  radius: 6, // The radius of the inner circle
  corners: 1, // Corner roundness (0..1)
  rotate: 0, // The rotation offset
  color: '#000', // #rgb or #rrggbb
  speed: 1.2, // Rounds per second
  trail: 50, // Afterglow percentage
  shadow: false, // Whether to render a shadow
  hwaccel: false, // Whether to use hardware acceleration
  className: 'spinner', // The CSS class to assign to the spinner
  zIndex: 2e9, // The z-index (defaults to 2000000000)
  top: 'auto', // Top position relative to parent in px
  left: 'auto' // Left position relative to parent in px
};
var spinner = new Spinner(opts).spin();
$("#sendstatus").append(spinner.el);
});
from this javascript code:

Code:
function CheckFileType( fileName, fileTypes ) {
if (!fileName) return;

dots = fileName.split(".");
fileType = "." + dots[dots.length-1];

if (fileTypes.join(".").indexOf(fileType) != -1) {
     //>>>>>>>>>>>>> ACTIVATE spin.js JQUERY PLUGIN HERE <<<<<<<<<<<<<<<<<<<<<<
   return true;
} else {
   alert('Please select a ScreenShot file (.tga) only!');
   return false;
}
}
I have tried using this method which i found from answers in other questions:

Code:
if (fileTypes.join(".").indexOf(fileType) != -1) {
    function startSpin() {
    var target = document.getElementById('demarrer');
    var spinner = new Spinner().spin(target);
    }
   return true;
} else {
   alert('Please select a ScreenShot file (.tga) only!');
   return false;
}
}
and this method

Code:
if (fileTypes.join(".").indexOf(fileType) != -1) {
   var spinner = new Spinner(opts).spin();
   return true;
} else {
   alert('Please select a ScreenShot file (.tga) only!');
   return false;
}
}
but it won't work...

The HTML codes:

Code:
<div id="sendstatus"></div>
<input name="ScreenShotFile" id="ScreenShotFile" type="file"/>
<input type="submit" id="uploadScreenShot" value="Upload" name="uploadScreenShot" onClick="return CheckFileType(document.getElementById('ScreenShotFile').value, ['.tga']);" />
Thanks
JeremyJohn is offline   Reply With Quote
Reply

Bookmarks

Tags
activate, call, javascript, jquery

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:47 PM.


Advertisement
Log in to turn off these ads.