jquery

Understanding the basics of JSONP and Rails.

I'm having a tough time finding some basic information on the accepted way to do JSONP with my app... Let me explain, say I have an app (App A) that provides a response in json, how can I call that script using jQuery from a different site, and load that JSON data? I'm pretty sure I can just link to a JS file on app A and use that to lo...

Page Shadow Effect: Catch the Focus Out Event

Here is what I am thinking: When a user browses some other page, or uses different application, or to say straight is not actively interacting with the webpage I want to catch this as a event and trigger a fadeIn() function. In this particular case only, I want to fill the page with shadow, which fades out once the user is back. The qu...

Form does not submit when running jQuery's submit() function

Hi, I have a form with the following HTML below: <form id="course_edit_form" name="course_form" action="/courses/save" method="post"> <fieldset> <div id="side-left"> <!-- Course Name --> <input type="hidden" id="course_id" name="course_id" value="${c.the_course.id}" /> <div> <label for="n...

Noob JavaScript Question - trying to assign a variable from a html text input and then have that variable used in a function

I'm trying to assign a variable from a html text input value and then have that variable used in a function that uses the jquery ":contains" selector to hide divs that don't match the variable...here is the code I have... <head> <script language="JavaScript" type="Text/JavaScript" src="jquery.js"></script> <script language="JavaScript" ...

Is than any better way for Round corners for Div with jquery.corner.js?

I am currently using jquery corner for making a div round cornered. But the problem I am facing is that when the background of that rounded div is a gradient, it is showing some odd colors in the corners. I want to know any other better way for including round corners for div EDIT 1: $(".nav").corner("20"); This code im using for th...

Iteration over jquery object returning string instead of dom elements

I have the following loop: for(var myScreen in wizardScreens){ if(step==index)$(myScreen).show(); else $(myScreen).hide(); index++; } wizardScreens is defined as $(".wizardScreen", wizard);, where wizard is a DOM element. Within the loop, myScreen is set to a string, instead of being a DOM element. Can anyone explain why t...

nivo slider - next and prev image

Hi, has anyone ever used nivo slider for images? I'm having an issue with showing the next and prev images for the navigation. It shows the prev image for boh next and prev navigation. can anyone help please? ...

JQuery html() vs. innerHTML

Hi, Please tell me, Can I rely completely upon jquery html() method that it'll perform like innerHTML? is there any difference between innerHTML and jquery html() method? and if these both do the same work can I used jquery html() method in place of innerHTML? My problem is: I am working on already designed pages, the pages contains ta...

jquery dragable across columns but not rows

I'm looking for a jQuery plugin that will allow me to drag items across columns but not rows. So say I have a table of 2 rows and 3 columns. All the items begin in column 1 with some in row 1 and some in row two. Now, items in row one can only be dragged into columns in the same row and same for items in row two. There are plenty o...

addClass("test") doesn't work - but css("background","red") does.

Anyone know why? Here's the JS: $(".screenshots .tab1").hover(function() { $(".section1").addClass("test"); }, function() { $(".section1").removeClass("test"); }); }); And the CSS: .test { background: black; border: 1px solid #ffb75b; background-color: #fffadb; } ...

Problem with JSON

var obj = { '51' : { 'name':'name1'}, '66' : { 'name':'name2'}, '58' : { 'name':'name3'} }; $(function() { s = ''; $.each(obj, function(k, v) { s += ' '+k; }); alert(s); }); In IE and Firefox it's 51 66 58, but in Opera and Chrome it's 51 58 66 Why Jquery.each() sort by key in opera, chrome? What can i...

Jquery - Set live('hover') and bind('contextmenu') on the same .class?

Hi, it is possible to bind Live('hover') and bind('contextmenu') on the same .class? This code dont work $('.too').bind("contextmenu", function(e) { e.preventDefault(); $('#ttt').append('click ' + this.id + '<br />'); }); $('.too').live('hover', function(event) { $('#ttt').append('click ' + this.id + '<br />'); } }); her...

Finding highest z-index of all elements

I need to implement an alert-type modal popup that appears with a dimmed background. The problem is, we may have other elements on the page being showed that are also modals with z-indexes above default. How do I determine the appropriate z-index that makes a given element the highest-layered element? (jQuery is fine.) ...

extract file full path using javascript

Hi, I am working on photo uploader.I have a requirement like when user select photo from Desktop. I need to show photo and name both before he will start click on upload.The reason being showing the photo at client side is because he can verify by seeing photo at first. so my problem is I m not getting the path. when i m using <i...

jquery sort element with array value

I need to sort some elements depend on it attribute. For an example: <div id="sort"> <div n="1"></div> <div n="2"></div> <div n="3"></div> <div n="4"></div> </div> And array_num {3, 2, 1, 4} pseudo code: $('#sort').sort(array_num, 'n'); results will be: <div id="sort"> <div n="3"></div> <div n="2"></div> <div n="1"></div> <div...

Issues with jQuery .live() event binding!

Hi, I am facing a very wierd issue with jQuery live event binding. $(document).ready(function (){ $('select').live('change', function () { // works fine }); $('input:checkbox').live('click', function () { // doesn't work! }); }); If I switch the order, $(document).ready(function (){ $('input:checkbox').live('click'...

Accessible way of hiding an element until jQuery's $(document).ready()?

I have a large survey that I have made more usable with jQuery by arranging it into sections and using an accordian menu to flip through each section. The trouble is, there is a noticable snap when $(document).ready() fires and condenses everything into an accordian menu. That is to say that before $(document).ready(), you can see the w...

How to detect inactive tab and fill it with color

How can I fill my website with color if tab is inactive? I would like to give screensaver like effect to my site if user move to another window. Can I do that with jQuery? ...

How to enable scrolls when browser resized

I have simple html table on the page. I want to add horizontal-vertical scroll bars to the table when the browser is resized to continue showing the table content. How can I do this? ...

jQuery selector for child of sibling?

Hi, I'm trying to get a jQuery selector for the child of a sibling (multiple sections on the page so need to just reach the sibling's child (rather thna being able to use a general selector). HTML: <div class="tour-section"> <div class="screenshots left"> <div class="tab tab1"></div> ...