I'm trying to write some JS replicating jQuery's fadeIn and fadeOut functions. Here's the code I have so far:
function fadeIn(elem, d, callback)
{
var duration = d || 1000;
var steps = Math.floor(duration / 50);
setOpacity(elem,0);
elem.style.display = '';
for (var i = 1; i <= steps; i++)
{
console.log(i...
I've five images and would like to display it in a same div one by one with interval of 2 sec. Can anyone please suggest any solution for this?
...
How can I use globalCompositeOperation for erasing something?
http://canvaspaint.org/ has an eraser, but that's just a white line - ok only if your background is white...
I know you can use ctx.clearRect(). But it didn't really worked for me because while dragging a mouse with eraser (set to 8x8px) it only makes unconnected 8x8px squa...
I am adding jQuery and swf library dynamically, onloading these libraries i am calling a method but the method is called twice, it works fine on local but on website it(methodCall()) fires 2 times.
function importJS(src, look_for, onload) {
//if already exists
if (eval("typeof " + look_for) != 'undefined'){
wait_for_scri...
Hello,
I am making a jQuery Ajax form submit to a PHP page that I want to return values dynamically instead of all at once. For example, if my jQuery code is:
jQuery.ajax({
type: "POST",
url: "$PathToActions/Accounts.php",
dataType: "html",
data: "action=register&accounts=" + accounts,
success: function(re...
I am embedding swf object into my html document, but its showing border on top and left of swf object, how to remove it?
Same result on all browsers. If i increase the dimensions of swf object then border start appearing on all sides. I dont want the border at all.
...
<ul id='myid' >
<li>Microsft Office</li>
<li>Microsft windows XP</li>
<li>Microsft windows Vista</li>
<li>Microsft windows 7</li>
<li>Microsft windows server 2003</li>
</ul>
<input type='button' id='mybutton' value='submit' disabled >
jquery
$("#myid").click(function(){
$("#mybutton").attr("disabled", false);...
Hello I'm quite new to using jQuery and I was trying to create a menu that showed different pictures when you moused over the links. It will show one picture and hide 4 others and when you mouse off a link it will go back to a default picture. I'm using the hover function but sometimes when I moved the mouse to the bottom both images (th...
I'm developing a product to be used by a number of customers alongside our Web application.
Quick background:
These customers have incorporated into their pages a widget that we've developed.
The widget's content can be modified by using our application.
The idea behind this product is a bookmarklet that we supply, which will "highlig...
I have a Repeater and also a Button. If I click on my button a new rows need to be created to the repeater in client side (javascript). I am able to do this with server side, but want to avoid a postback. I am not using an Ajax Updatepanel control. Moreover I am using a table structure in my Repeater.
...
I am trying to build a javascript regex based on user input:
function FindString(input) {
var reg = new RegExp('' + input + '');
// [snip] perform search
}
But the regex will not work correctly when the user input contains a ? or * because they are interpreted as regex specials. In fact, if the user puts an unbalanced ( or [ ...
I used this,
<a title="Logout" onclick="javascript:document.getElementById('ctl00_ContentPlaceHolder1_LbLogout').click();" href="#" class="logout">Logout</a></li>
<asp:LinkButton ID="LbLogout" runat="server" style="display:none"
onclick="LbLogout_Click">Sign out</asp:LinkButton>
The anchor tag doesn't seem to fire my linkbuttons on...
For example I have a string that looks like the following:
var example_string = "this is the example string\n <-don't want \n\n\n";
Here I've made a string that has four newline characters in it, with three consecutive on the end. How can I programmatically have javascript tell me that there are 3 newline characters on the end?
...
What's the best way to have a text input field that displays instructions of what to enter in that field in gray. When you focus on that input field, the gray instruction text disappears and your input text appears black. If you erase your input text and focus away from that input, then the instruction gray text reappears.
I've tried ...
hello,
i have this json structure and I made it into an array. I was trying to remove the entry, but this code failed on me: http://stackoverflow.com/questions/1728727/remove-item-from-array-if-it-exists-in-a-disallowed-words-array
var historyList = []; // assuming this already has the array filled
function add() {
var newHistory...
In Interspire I copy a template & paste it then rename it & I customize it according to my theme but when i go into admin & in admin when i click on design mode then there should be site open for making changes but in my new template it is not open in proper way & I am not be able make changes in this mode please tell me why it is ...
I want to grab a form object from an external javascript function instead of passing it from a submit button inside the tags.
So for example lets say my form is:
<form id="form1">
//inputs...
</form>
Normally I would just put a button in there with onClick="submitFunction(this.form)" to pass it to my javascript function, however no...
This is a two part question - first I need to get every element that is a child (or subchild, etc) of a parent element, and then I need to reset it's style. As such, I'm looking to do something like the following:
var everything = parent.getEveryElementBelowThisOne();
for (i=0; i<everything.length; i++)
everything[i].css = "font: 10...
Hello there, I'm creating an extension for Google Chrome, so any code has to be compatible with Chrome and Chrome only. In this extension, I need the user to select a folder from his local machine. This simple task is becoming quite a problem. The chrome extensions options page will not run applets, so I couldn't really do Java. It's Goo...
Hi
I am having a problem understanding which function runs (probably in infinite loop) in my JS code.
Is there a plug\way to see the list of the setTimeout functions that are running?
thank you
...