jquery

jquery $.function()

how can i write a plugin/function and then be able to call it like this(no selector required) $.function() noe i write my plugins something like this: (function($){ $.fn.extend({ //function name myFunction : function(){ //........... } }); })(jQuery); ...

[jquery] fadein / fadeout div on checkbox select / unselect

Hello, I am trying to bring up a menu when any of the checkbox is selected, as you can see in screenshot below, it shows the number of selections and the menu also disappears when none is select. I am able to bring up the menu with this code $("input[name='id[]']").focus(function(){ $("#menu").fadeIn(); }); However, i dont kno...

jquery: how to get the value of id attribute?

Basic jquery question. I have an option element as below. <option class='select_continent' value='7'>Antarctica</option> jquery $(".select_continent").click(function () { alert(this.attr('value')); }); This gives an error saying this.attr is not a function so im not using "this" correctly. How can i get it to alert 7? ...

Hover using javascript

Hi all, Here's what I would like to do. I have 2 identical lists that I would like to have change color on hover of a specific item on both lists simultaneously. Example: List One List Item 1 List Item 2 List Item 3 List Two List Item 1 List Item 2 List Item 3 So if you were to hover over List One's first item it would highlight...

change image after timeout

i have following code <div class="caption" style=" position:absolute; margin-top:0px"> <img src="caption/img1.png" /> </div> <script> $(document).ready(function(){ setTimeout(function() { $('div.caption').fadeOut('slow'); $('div.caption').fadeIn(); }, 1000); }); but this work only once, what i want to do is after e...

global Javascript files and naming conventions (unobtrusive javascript)?

Hi there, I am trying to reorganize my javascript into JS files and clear out my js from my html... The way i see if is the following.... I would really like some input or any documentation/information confirming my plans - a little uncertain. Basically if i have a Home.htm file then i will have a home.js file also, notice they are na...

loading js files dynamically via another js file?

Hi there, is there anyway to load other JS files from within a single JS file. I would like to point my individual pages "ITS" js file and that js file would load jquery, other js files. I know i can just pop all these into the html i.e. I was thinking of separations of concerns so i was wondering if anything exists already without ...

show detail information in between table rows with jQuery

I have a table where I'm displaying some header information. I have a link on the far right of the table that, when clicked, I would like to have the detail information appear beneath the current row. How can I achieve this effect? --Edit-- using your idea below, I tried the following code (which did not work) - function showRdmDtl(f...

combining effects in jquery

How would I alter the below page and code so that when my 'news' P fades out the content below it... slides smoothly up instead of jumping. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <me...

"Pin Menu" using JQuery

I don't know what to call the type of menu that RegexPal use for their quick reference, therefore I've called it a "Pin Menu" (not sure if there's a more appropriate name?), but I'd like to recreate the functionality which essentially is: Opens on mouse over and closes on mouse out. Pin functionality to keep it open permanently. Clos...

jquery not working IE7

i am using http://malsup.com/jquery/cycle/ with jquery my code is <script> $(document).ready(function(){ $("div.hide1").fadeTo("slow", 0.13); $("div.hide1").fadeTo("slow", 1); $('.caption').cycle({ fx: 'fade', speedIn: 2500, speedOut: 500, sync: ...

JS detect upload from a new window

I have a windows, which in there is a upload button. When user click this button, it will popup a page for user to upload the desired file. But i dont know how can the main page detect if the user uploaded and add a field to the main form? I've been seeing this somewhere but i dont remember so i can't go back to check out the source JS....

jquery search / combobox combination?

I wish the following: a text input a "go" button You type in the text input. If you hit enter or the "go" button, it puts (remote) search results in a drop-down for you to select (each item has an image and some text). If you start typing again, it clears back to original state (i.e. no drop-down). I'd like it to be jquery or a jq...

flir on caption of Lightbox

Hi, I'm wondering how you could add flir on the captions of a lightbox. I already managed to display the flir on the first picture you select but when you go to the next picture without closing lightbox the caption is regular text. this is how my footer looks <script src="/js/flir.js" type="text/javascript"></script> <script type="tex...

How do you structure your jQuery code?

Coming from mootools and JAVA, mootools class implementation is a real nice way to structure my code, plus I can have some nice features like extending, implementing and so on. Starting with jquery I found my self writing $.fn plugins that cant use code of other plugins. Plus it seems no good idea to use the plugin structure for complex ...

Jquery Popup and JSon Problem in MVC

I have a couple of TextBox controls in a JQuery Popup: <li id="lblAmountPerTurbine"> <label for="AmountPerTurbine"><strong>Amount Per Turbine:</strong></label> <%= Html.TextBox("AmountPerTurbine")%> <%= Html.ValidationMessage("AmountPerTurbine", "*")%> </li> <li id="lblAmou...

Google slideshow shows a blank screen when calling from ajax

I'm having problems implementing google slideshow (http://www.google.com/uds/solutions/slideshow/index.html) to my web application by loading it using a jquery load() function. index.html: <script type="text/javascript" src="jquery-1.3.2.js"></script> <div id="moshe"></div> <script type="text/javascript"> $(document).ready(function(...

[js] link to itunes (itms://...) without opening a new window

how do i call a link to itunes (itms://...) without opening a new window. with window.open there comes a new window (as the function says :)) $.get('itms://...'); doesn't work. Any other possibilitys :)? would be thankful for help! ...

Animate width left to right

I am trying to find a way to animate a div using jQuery to shrink the width from left to right. I have the element on click at first: slide in from left to right then have it continue to the right off my div, like it just keeps moving off the page, comes in and click again comes off. I have the toggle function in and working properly,...

Why is my jQuery code failing to match elements with dynamic ids?

This code is supposed to add a class attribute to the span element "saved" with the right id. but somewhat its not doing so. Perhaps something I am missing, cant seem to figure it out. <script type="text/javascript"> jQuery(function($){ $("a[id^='savebook-']").click(function(){ match = this.id.match(/savebook-(\d+)/); saved...