jquery

jQuery : add css class to menu item based on browser scroller position

Hi, I have a menu: <ul class="menu-bottom"> <li id="m1" class="active"><a id="1" href="#"><span>Link 1</span></a></li> <li id="m2"><a id="2" href="#"><span>Link 2</span></a></li> <li id="m3"><a id="3" href="#"><span>Link 3</span></a></li> </ul> I want that depending of browser's scroller position, the "active" class goes th...

jquery append choking on quotes in ei

This jQuery statement works in recent versions of Firefox and Chrome but throws an error in IE 8. left_bar_string = "<tr><td><a href='#' onclick= "return newPopUpWindow('somelink','window', '1000','800','100','0','yes')">Directions</a></td></tr>"; $("#side_bar").append(left_bar_string); I think problem is with double quotes. Any com...

jquery effects (show)

Is there a way to just have something "show"? I know there's the effect called show, but I mean something with no animation. I know I could make the speed way fast or something. Or I could change the css from hidden or something. But does someone know of a built in method that does that? Same with "hide". ...

jQuery replaceWith(data) is not correctly doing his job

Hello, i did a small ajax div refresh, but instead of replacing the values with the new ones, jquery adds the new data before the old ones. What possibily causes that please ? <script type="text/javascript"> $(document).ready(function(){ $('#AJAX').click(function(e){ e.preventDefault(); var heberg...

Javascript fine grain performance tweaking

I have been writing my first jQuery plugin and struggling to find a means to time how long different pieces of code take to run. I can use firebug and console.time/profile. However, it seems that because my code executes so fast I get no results with profile and with time it spits out 0ms. (http://stackoverflow.com/questions/2690697/fir...

Why this jquery plugin giving error in IE but working fine in firefox?

This page work in Firefox but not in IE7 http://www.robwalshonline.com/demos/randomImageDemo/randomImage_plugin.html This is page of plugin http://www.robwalshonline.com/posts/jquery-plugin-random-image-on-page-load/ How to get this work in all browser FF, safari, chrome and IE 6, 7 ,8 ...

Send multidimensional array to php with jQuery

hy, i have a little, big problem here :) after i upload some images i get a list with all the images. I have some jQuery function for rotate, duplicate, delete, shuffle images! when i select a image and hit delete i send a post to php with the alt="" value of the image,i identify the picture and edit. I want to make a save button, Inst...

How to differentiate between two class of same name in different css on same page.

on my asp.net page i am linking 2 css files which are used by 2 different controls but the main problem is that one class name is same in both so they are conflicting with each other, please tell me how can i distinguish between them. Both are of jquery, 1 is slider control and another one is time picker control. and they are conflictin...

jQuery: how to replace content without affecting children

hi, I want to replace tag with tag, but not replacing all the children elements (just the parent). How to do it with jQuery ? thanks ...

Filtering content (jQuery)

HTML: <div class="filter"> <a href="#category-1">category 1</a> <a href="#category-2">category 2</a> </div> <ul class="items"> <li class="category-1">item 1</li> <li class="category-1">item 2</li> <li class="category-2">item 3</li> <li class="category-2">item 4</li> </ul> What I want is for example clicking on ...

Preserving Tabs in POST Data

I need to preserve tab characters from a textarea through POST Data. It seems that there's no way to differentiate tabs from spaces in the $_POST array, and this is really frustrating me. I'm using a jQuery plugin from here to allow for tab and shift+tab usage within a textarea. http://teddevito.com/demos/textarea.html The jQuery plugi...

How to construct a URL to open a iframe window with jQuery fancybox plugin (lightbox)

Hello, In my web site there is home page, and all other pages open using fancybox window - with iframe. I want to be able to construct a URL like www.example.org/About.html which will send the user to my website and will open the iframed page {About.html} within the fancybox window. Thanks for help. ...

Managing active state (jQuery)

<ul> <li><a href="#">item 1</a></li> <li><a href="#">item 2</a></li> <li><a href="#">item 3</a></li> </ul> On click, I'd like to addclass active to the parent li element while also removing the active class from any other element which may be active already. Thanks! ...

Jquery add table row after the row which calling the jquery.

Hello! I've got a table. <table id="servers" ...> ... {section name=i loop=$ownsites} <tr id="site_id_{$ownsites[i].id}"> ... <td>{$ownsites[i].phone}</td> <td class="icon"><a id="{$ownsites[i].id}" onClick="return makedeleterow(this.getAttribute('id'));" ...></a></td> </tr> {/section} <tbody> </table> And this java script. <...

JQuery focus an element

In javascript the following works to give focus to the edit_2 input box: document.getElementById("edit_2").focus(); However using Jquery this does not: $("#edit_2").focus; ...

What's the best way to call jQuery scripts, in HTML/PHP template, or seperate js file?

StackOverflow is telling me this is a subjective question, but I think it's a matter of fact! I have a number of scripts that I'm using on different parts of my site. In terms of making fewer http requests, I know it's better to combine all of these scripts into one .js file. However, isn't a waste of time for a page to call a .js full ...

How to submit the form using JQuery UI?

I have a form in html with a default submit button. After the form is submitted, a php file is run (with action = homelocation). I decided to use JQuery UI dialog to display the form. I have 2 default buttons there - one to save and one to close the dialog. Can anyone tell me how to assign the form submit button action to the JQuery dial...

Using jQuery, how do you change the image on hover inside of a div?

I have the following jQuery code to replace an image when you hover over with the mouse but it doesn't seem to be working. What is wrong with the code below? $(function() { $("div.delete img") .mouseover(function() { $(this).attr("src", "../../images/comment-hover-del.png"); }) .mouseout(function() { $(this)...

why this jquery code doesn't work if i add class to <P>

It works var tip = "<p>Most computers will open PDF documents automatically, but you may need to download <a title='Link to Adobe website-opens in a new window'"; tip +=" href='http://www.adobe.com/products/acrobat/readstep2.html' target='_blank'>Adobe Reader</a>.</p>"; if($("div#maincontent a[href*='.pdf']").length>0){ $("div#mai...

What are CDN Best Practices?

Hi, I have recently started using the Rackspace Cloudfiles CDN (Limelight), about which I have some questions: I am using jQuery, jQuery UI and jQuery tools in addition to custom JS code. Also, my site is written in ASP.Net, which means there is some ASP.Net generated JS code. Right now what I have done is that I have combined all o...