javascript

Transparent image - is it possible in JS?

Is it possible to set transparency of any image in javascript? And how can I do that? ...

Prototype startsWith OR

Hi Guys, I am trying to use Prototype and startsWith but I want to check a number of values and little confused how to do this. Basically have this code: if(Category.startsWith("[Test1] " || "Test " || "Test2 ")) { some stuff } It doesn't appear to be working and just wondering what I am doing wrong ? ...

JQuery: Can't figure out the error

Hello, I have this code: $('.user_info').click(function(){ var pos = $(this).offset(); rel_value = $(this).attr('rel'); $('#' + rel_value).css({top: pos.top + 'px', left: pos.left + 'px'}); $('#' + rel_value).show('slow'); $('#' + rel_value).hover(function(){}, function(){ $(this).fadeOut('slow'); }); ...

jQuery event bubbling: How to capture a nested click?

I'm capturing a click on any given LI in: <ul> <li class="opt">Text 1</li> <li class="opt">Text 2</li> </ul> With the code: $('.opt').live('click', function(event) { console.log("Click!"); } and it works wonderfully :) However, I also need to support the ability for nested block elements to exist inside the LI, without...

Move Scrollbars With JQuery

Hello, I have been creating an image gallery with JQuery, all is done. The images are placed side by side horizontally within a div whose overflow id hidden (don't want to show scrollbars). I have two images arrow left and arrow right within links. Now I want to do is that when i click left arrow, it should show previous image and when ...

Does HTML and CSS needs to be valid before we apply JavaScript?

Hi all, I was thinking about Web standards, and i was wondering if we need to have valid HTML and CSS before we apply JavaScript? Can anyone enlighten me on the relation between valid HTML, CSS and JavaScript? For instance, does invalid HTML and CSS prevent JavaScript from working correctly? Best Regards. ...

Calling JS Function on Form Submit

I have created a JS function which executes fine when it's included an the 'onclick' action of standard HTML link tag as follows: <a href="#" onclick="return fb_CheckPermission('publish_stream');">test</a> However where I really want to use this function is on the 'onsubmit' action of a form but when I include it as follows the functi...

JQuery Image Gallery

Hello, I have made a image gallery with jquery found here: http://sarfraznawaz2005.kodingen.com/demos/jquery/image_gallery/ I just wanted to know how to i add functionality to prev and next arrow images to show next and previous images with jquery. Thanks. ...

"Proprietary" HTML tags in HTML 4.01

My last company, which used 4.01 DOCTYPE exclusively, decided to add some new functionality based on use of proprietary tags in the form of <pp:foo attrOne="something" attrTwo="something else"/> for certain purposes in their .aspx pages. In the beginning they broke a lot of Javascript until I sussed out that when these proprietary tag...

JavaScript Calculation

calculate the difference in array using a looping structure without a sorting function ...

API to get hostname from Jscript

Hi, I am not sure why my previous post was not listed. Lets see if this one gets listed. I have a stand alone jScript which passes parameters to a C# program. I have to pass hostname to the C# program. Is there an api which I can use to get hostname in the jScript if not can I do it using the 'hostname' system command? Thanks in Advance...

Can I pass a value out of a javascript function?

Hello, Can I pass a value out of a javascript function and back to the calling function, e.g. function updateURL(url, name, param) { url = url + "&" + name + "=" + param; } I want to update url and return the new value. Is this possible? ...

Plot Equations using Javascript (or anything client side)

Is there any library which I can use to plot mathematical equations? (Preferably using javascript, could me in Java also; or anything clientside) ...

More elegant way to show | hide in jQuery

Hi Guys, I am learning jQuery and just came up with this - but really not sure whether it is the best solution. Would someone be able to assist and tell me whether this is something more "elegant" ? $('#hde_test').hide(); $('#shw_test').click(function() { $('#shw_test').hide(); $('#hde_test').show(); $('.class1').show(); ...

Using Javascript for styling content

Is there a problem to using javascript for styling content? My website requires javascript. There is this text on my website that I want vertically centered. The text could be either 2 lines or 3 lines long. With javascript I could vertically center it pretty easily. The CSS ways to vertically center it seem complicated and includ...

Progress Updates on Long Process with Javascript

Hello, I have an asp.net page that calls a dll that will start a long process that updates product information. As the process is running, I want to provide the user with constant updates on which product that process is on and the status of the products. I've been having trouble getting this to work. I add information to a log text fil...

problem with sIFR 3 not displaying in IE just getting XXX

I am having a problem with sIFR 3 not displaying in IE. I get 3 larges black XXX in IE yet it displays fine in Firefox. I have checked i do have the most recent version of flash installed correctly. Here is the code on the page <div id="features"> <div id="mainmessage_advertisers"><h2>Advertisers</h2><br /><br /><h3><a ...

Show image with link based on first directory with Javascript

Hi, i need some help please, i want to show an image on my Page depending of the first directory of the URL. Example: In Any of this URLs will show the image1.jpg www.mysite.com/audio/amplifiers/400wats.html www.mysite.com/audio/ www.mysite.com/audio/amplifiers/ In any of this others will show the image2.jpg www.mysite.com/video...

word decoder by javascript ?

Implement the “Word Decoder” game. This game will present the player with a series of scrambled words (up to 20 words) and challenge him/her to attempt to unscramble them. Each time a new word is displayed, and a text input is provided for the user to write the unscrambled word. Once the player thinks the word has been properly decoded, ...

jQuery: Loading swf file from server after the button click

Hi, I have a web page with swf file defined this way <object width="600" height="400" type="application/x-shockwave-flash" id="plist" data="/site_media/apps/problemme.swf"> <param id="board" name="flashvars" value="id={{ id }}"> </object> What I want to do is to reload this object after button click (also I want to change value o...