[jQuery] Deselecting all items in a <select>-field..
Hi all, This is something I spent way too much time on, trying to figure out why it didn't want to do what I wanted in IE7. I'm posting it here, so maybe it will save some others a bit of time. The problem: You have a <select> and you wish to deselect all options. It turns out that you need to change the code, depending on whether you're using a select that can take multiple options or not. Both versions work in FF and Safari for both variants, but for Internet Explorer you'll need to use them as
Pre seclecting in a dropdown list
I know this is easy I just can not remember how to do it. I am getting some info from a DB and putting it in a drop down I would like to know how I can mark one as selected like day=tuesday . . <option name="something" if(day == "monday") selected> monday</option> <option name="something" if(day == "tuesday") selected> tuesday</option> . . . . Can someone please help.
Can't select a class in an if statement
Hi, I'm trying to create a form validation that will alert the user if the dropdown lists contains empty values but nothing happens with my code. What's wrong with it? $('#compute').click(function() { if ($('.required').val=='') { alert('Please complete the form before submitting again!'); } });thanks
Make an animation go at the same time
Hello, i'm pretty new to this forums 1st post :) but i've got a question.. i have this code: $("#n_link1").add("#n_link2").add("#n_link3").add("#n_link4").animate({ "height": "65"}, { duration: "slow" }); //Change everything back to 65px $(id).animate({ "height": "105"}, { duration: "slow" }); //Change the clicked button to 105px But the thing is now.. first it sets all to 65px so theres a white gap in my website after that it changes the button i clicked to 105px fixing the gap How can i make them
Animating links
Hi guys i got problem with link animation. Could you look at attatchment ? As you can see links moves from the right to the left but when there is a last link i goes from right to te left... How to make that is always going from the right side to the left ? How to change this loop ? Maybe there is an another, a better way to animate links similar to mine ?
replace default jquery $ sign
Hello All; Can anybody tell me how can I change default $ sign to any other sign like # or @ etc. The basic problem is when I try jquery with mootools js then mootools have also default $ sign so that bot are conflict to each other.
if statement compare number with element
Hi, I'm trying to get an element from <td colspan="4" align="left" id="mkv"></td>which receives its value via ajax, then comparing it with a number, unfortunately, I kept getting illegal character if (parseInt($(#mkv).html()) > 50000)\n in firebug? What am I doing wrong? Below is my code if (parseInt($(#mkv).html()) > 50000) { $('#coverage').attr('disabled','true'); $('#coverage option').attr('option',:first); }//end of if statement
How to insert the datepicker in the text field using dreamweaver
I read the tutorials and saw videos but i did not see a real tutorial on how to link this widget to my text box.
Add a class to canvas
I am working with the new canvas element. I have simplified my request. Can I add a class to the canvas JS? Currently the fill colour is set with 'context.fillStyle="red";' I would love have this in a class as I want to change the colour of the fill with jQuery. I am not sure where to start. <!DOCTYPE html><html><head><meta charset=utf-8"><title>Canvas</title></head><body> <canvas id="myCanvas"></canvas> <script type="text/javascript"> var canvas=document.getElementById('myCanvas'); var context=canvas.getContext('2d');
Superfish Jquery loading issue
http://aoitconsulting.com/dev2 is my current development site. I am testing Superfish as the menu, and it is working great, except that the site takes 3.8-4.5 seconds to load. Is there a way to speed this up?
$.ajax IE issue....
Of course this works in every browser except IE....help? Nothing displays at all in the list div... $.ajax({ url:'/index.php?sid=' + $_GET.sid + '&sub=99&id=' + $_GET.id + '&action=1&start=' + start<?= $activity->isShared() ? (' + \'&type=\' + $("#type").val()') : '' ?>, dataType: 'json', async:false, success: function(data){ $("#list").html(data.events); if (data.can_complete)
replaceWith() works only the first time
Hi everyone, I using jQuery for the first time. I want to use the the replaceWith() function in a html form with many select buttons to replace the select elements from a second button to other values when the value of a first select button has been changed. The html code is generated in a perl cgi script (I write this only for completeness). The function works but only the first time when I change the value of the first button (e.g. button "Type"). On the second change no more actions are done on
Using jquery can we grab one url and append it to empty element?
Using jquery can we grab one url and append it to empty element?
jquery plugin similar to extplorer
Hi Can someone pls point me to any jquery plugin for a file/folder browser similar to the extplorer ub ExtJS with tree hierarchy along with the grid and list view in the right pane: http://extplorer.sourceforge.net/extplorer.png Thanks in advance!
How to grab just a <table> from a jQuery .get()?
I'm using a jQuery .get() to fetch all the HTML from a page. This page has a couple different <table> sections but I'd just like to grab the entire table that has the data I want from <table> to </table> with none of the other HTML from the page. How can I do that? Unfortunately there's no "id" or "class" attributes on this table either so I can't select by id or class. Thanks!
Bug with .css()
Hi there, has anyone else had this problem? Basically after using $('#myEl').css( { 'top' : someValue + 'px' } ); And then using alert( someValue + '!=' + $('#myEl').position.top ), the 2 values are not the same. I've tried just increasing the value of "someValue" to fudge the required "top" value, but that doesn't get me where I want either...and it's not really a fix. I'd really appreciate any ideas anyone has...or a fix would be even better! ;) Thanks.
option for a vertical scoller that works with a form element
does anyone know of a good option [using JQuery of course] that will add a vertical scroll bar to an HTMl form? I need to have some static position stay in my top div and only have the form be scrollable. In my search I only came across horizontal scrolls. Thanks in advance.
Selecting dynamically created elements
Previously when developing my own modal windows I have been creating a "mask" div directly in my markup, in the CSS setting it to be display:none and then setting it to show() by jQuery when a button is clicked. I'm sure there is a better way to do this but i'm getting a little stuck. I tried adding the "mask" div and its content to the body using prepend() when my button is clicked but i found i then can't select any of the added elements in jQuery. How can you select elements you have added to
keeping floating layers within window / viewport
I'm working on a mysql browser / edit-in-place app which presents the user with a floating UI (think lightbox), that contains widgets appropriate for the given field they've clicked on. Presently, rather than centering the UI element like a lightbox however, I find it best to keep it relative to their mouse, so that they don't have to traverse halfway across the screen with their mouse to interact with the interface if they've clicked something (for instance) on the bottom left. The problem however
How to dynamically create accordion with jquery under Apex 4
Hi there, I would like dynamically to add one accordion Here is a simple example <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <title>jQuery UI Accordion - Customize icons</title> <script type="text/javascript" src="#IMAGE_PREFIX#libraries/jquery-ui/1.8/ui/jquery.ui.core.js"></script> <script type="text/javascript" src="#IMAGE_PREFIX#libraries/jquery-ui/1.8/ui/jquery.ui.widget.js"></script> <script type="text/javascript" src="#IMAGE_PREFIX#libraries/jquery-ui/1.8/ui/jquery.ui.accordion.js"></script>
ajax .post variable name problems
I've used jQuery ajax and .post a lot, and several times within the very application that i'm having issues with, but I've never run into this issue before. I've got a table of items and categories, sorted by a sort number. in the same cell that the sortnum input is in, there is a span with a status id that differentiates between items and categories so i can modify the correct records in the correct database table. First, i select all of the inputs and then sort them by the value of the input. next,
What happens if you deep copy $.extend() an object containing jQuery selectors.
What happens if you do the following? - That is deep copy a jQuery selector. myObj = { someProp: "myProp", selector: { start: $("#myStart"), stop: $("#myStop") } }; myCopy = $.extend(true,{},myObj); I'm concerned whether the myObj.selector object will deep copy the whole of jQuery as part of the process. My initial tests did not show any obvious speed hit, but it is rather a basic test right now.
How to create a jQuery pager?
I am trying to create a pager (similar to Example 4) and I tried using the creators file (from the download link) and it just never worked. Can anyone please help me? I just want to know how to use it...if you know other examples or places that could help me figure out how to build one, I would greatly appreciate it.Thank you!
Using the same animation on multiple elements
I am performing the same animation three different times on three different elements. Is there a more efficient way to do this? Here's my code: $('.tier1').animate({opacity:.2}, 500) $('.tier2').animate({opacity:.2}, 500) $('.tier3').animate({opacity:.2}, 500) $('.tier4').animate({opacity:1}, 500) I can't just give them all the same class name since the active tier changes to 100% opacity based on interaction and I'd have to do a removeClass and addClass which I imagine would be just as much code.
Getting an RSS Feed
I have a feeling that there is no way to do this but am posting this in case anyone has an idea. On my website at http://SoundsOfAmbience.com I offer a list of music I am currently considering for a future show. The list comes from an XML file that I save from my del.icio.us list (http://feeds.delicious.com/v2/rss/GLSmyth/SOA?count=15). It is a manual process to save the XML file that is painless, but would be much more convenient and up to date if I could access the file directly. It is my understanding
jQuery compress images.
Hey, I'm new to jQuery so this may be relativly simple. I'm trying to create a website where the images I need to rotate are 100% width/height (filling out the entire screen without scrolls). This is fine, as long as I have 1 image. If I add more images to my rotation in jQuery it compress the images to 100% width but only some ~100px in height. Screenshots: http://img341.imageshack.us/img341/6783/fine.png (One picture working) http://img811.imageshack.us/img811/7988/shite.png (3 pictures not working)
multi request ajax at the same time
hi everybody. i has a page that has three tabs . when user access page three tab get content by ajax. i want to get content three tabs at the same time. what should i do ? And i try to add sortable for my tabs but i don't work as i want. i want when i move tab everything in tab move together. this is my prolem http://stmb.net/news/. $(".tab").sortable({connectWith: '.tab'}); i want my tab sortable like http://jqueryui.com/demos/sortable/
.ajaxStart different to each $.ajax() call..?
Hello all, I have several Ajax calls inside one single page, i.e. // Example Ajax Function $.ajax({ url: 'phpPage.php?catId=14418350', success: function() { alert("Operation Completed."); }, error: function() { alert("Load FAILED."); }, timeout: 3600000 }); Nevertheless, I need different progress bars to be updated per ajax call: $('#hello').ajaxStart(function() { var i = setInterval(function() { $.getJSON("progressReporting.php?catId=14418350", function(data) { if (data == null) { clearInterval(i);
jQuery .post page into div problem
I'm using jquery to load a php page into a div via buttons. The buttons are loaded through a php while function. All of the buttons are given the id of bagView. When the buttons are created there are also hidden input feilds with the id of equipId. The jQuery runs when bagView is clicked. jQuery uses the hidden inputs value (which is the ID of the information i need) to grab a page usin the ID and displays the page in a div with the id of itemView. It works great when I click the button for the first
Loan calculator using JQuery
Hello, I need to develop a Loan calculator as in www.bizztools.net It is possible to make it using JQuery? If yes kindly suggest the way out. Thanks in advance for your time. Regards Yug
Configuring plugins
Hi, I have a plug-in that requires a bit of code to configure. I use it multiple times with the same configuration, and I don't want to clutter my script each time with the configuration. The following works fine, however, I wonder if there is a more jQuery way of doing it. Thank you <script type="text/javascript"> $(function() { $("textarea.tinymce").tinymce(tinymce_setup()); }); function tinymce_setup() { return({ // Location of TinyMCE script script_url : "lib/js/tinymce/jscripts/tiny_mce/tiny_mce.js",
Gridview highlighting does not work
Hi. I have a gridview, and when a user clicks a row, the row should be highlighted. If the user clicks another row, this newly clicked row should be highlighted, but the other row should loose its highlighting. That means, that only one row can be highlighted at a time. I´ve seen several solutions for this, that were way too overkill. So instead I have this solution: $("#MainContent_GridViewResults tbody tr").click(function () { $("#MainContent_GridViewResults tbody tr").each(function () {
Passing ElementID into a php variable
Hi, I sort of ajax a data into a div id, but I was wondering, is it possible to pass the items in the div element into a php variable? Thanks
How to trigger my pop up if the users mouse is idle for 1minute???
Hi Guys, I'm really new to jquery but trying to learn. I have successfully managed to get a pop up dic with a faded black background to trigger when a link is clicked but i really need to trigger the pop up if the users mouse is idle for 1 minute. I found this Click Here which looks like the timer idle script but i cannot figure out how to implement it with my script. If anyone knows how please can you help me out... heres the .js file i have already var $j = jQuery.noConflict(); $j(document).ready(function()
HELP: addClass, removeClass
Dear, I have write jQuery script as below and added class "minus" when I click on h1, how do I click again h1 to remove class "minus"? <script> $(document).ready(function() { $(".features h1").click(function() { $(".features ul").slideToggle("fast"); $(".features h1").addClass("minus"); }); }); </script> <div class="features"> <h1 class="plus">Feature</h1> <ul style="display: none;"> <li>hello world</li> </ul> </div> Thanks~~~
How to submit a form onClick [checkbox] ?
If I have this: <input type="checkbox" name="blah"> what do I need to write into the onClick attribute to make it submit? I want the user to be able to submit the form when this checkbox is clicked.
Slidedown div with closeout button and cookie detection -- possible?
Hi, I am trying to do something which I feel is very simple but I am new to all this, so any sort of pointing in the right direction would be great. 5 seconds after my website loads, I want a div to slide down from the top of the page (and be ontop of all my other site content, as to not shift it when it slides down). Kind of like this: http://www.webresourcesdepot.com/wp-content/uploads/file/jquery-sliding-menu/# Except, it should by default slide down automatically 5 seconds after the page has
openwysiwyg & jquery
Hi, I've recently added jquery to list of libraries used by a web application I am developing. Initially, this application used prototype for AJAX calls, but I have switched all this type of calls to jquery (prototype is still used by some external libraries without conflicts). Application runs well and is enhanced by jquery. One part is however problematic: openwysiwyg editor (v. 1.01 openwebware) is not working in FireFox (it also works partially in Google Chrome). If I place the editor directly
problems with opera and css modification..i think...
Hi, i'm using jquery for a website. I need to set the absolute position of a div so i'm doing like this: $(document).ready( function(){ $('.main_menu').css("position","absolute"); $('.main_menu').css("top", ( $('.photo_container').height() - $('.main_menu').height() ) / 2 +50 + $('.photo_container').position().top); $('.main_menu').css("right", -25 + $('.photo_container').position().left); });It works with chorme,firefox but not with Oepra.... Anyone can
Help... How could I animate/fill a shape with a color from bottom to top?
Hi, I'm trying to create an animation that would fill a complex shape (say an arrow) with a color from top to bottom. It'd be something similar to the third button in the button lab on www.dontclick.it (Enter the site, go to button lab, select "Click Replaced by Timer". Can't link to it specifically cause it's all Flash). Any ideas? Thanks in advance, ben
Next Page