[jQuery] accesing array/variables with a function
Hello I'm having problems with the following code: for (var i = 0; i < images.length; i++) { var img = new Image(); img.src = images[i][0]; $(img).bind('load', function() { stack.push( $('<a/>').attr('href', images[i][1]).append(this)[0] ); }); } The problems seems to be because stack.push cannot access images[i][1] which is a two-dimensional array, defined after/in $(document).ready (function(). The error I get: images[i] is undefined [Break on this error] stack.push( $('<a/>').attr('href',
[jQuery] What's the best way to replace text in a node?
I'm guessing this should be a simple one for the jQuery stalwarts here. I've recently moved over from Protoype and was used to using the update() function to replace text within a node - something like this: PROTOTYPE <p id='dText'>text to be replaced $('dText').update('New text string') JQUERY <p id='dText'>text to be replaced $('#dText').remove().append('New text string') Now it appears to me that in jQuery, there isn't an out of the box function to replace the contents of a node without also replacing
[jQuery] images height() or attr("height") for dynamically added elements
Hello everybody. I am experiencing difficulties in calculating the height of dynamically added images. I have a new plugin wich i have already released and i'm happy wih it, but one of settings users can choose is to change the 'layout' of the buttons in the gallery by adding an image instead of the default +/- text. To properly vertically-align an image i use to calculate the height of the contaner /2; then the height of the image to insert /2 and add margin-top to that image to place vertically
[jQuery] JQuery css selector
Hi everyone, How can I use the jQuery css selector on click function when the user clicks on the delete <img> or the delete < a href> tag? <code> <div id="ribbon"> <span class="right"> <ul> <li> <a href="/items/makeActive/444"><img src="http://example.com/images/ checked.gif"/></a> <a href="/items/makeActive/444">Make Active</a> </li> <li id="delete_item"> <a href="/items/delete/444"><img src="http://example.com/images/ unchecked.gif" /></a> <a href="/items/delete/444">Delete</a>
[jQuery] How can I make diferent things depending on the 'msg' variable?
Hi, The fact is, I want to have diferent functions depending on the 'msg' variable. For example, if the msg variable is "error" i want son events to hapen a some other events not. My code is this: $('#login').ajaxForm({ url: 'revisar.php', beforeSubmit: function() { $('#loginCaja').html('Por favor espere...'); }, success: function(msg) { $('#loginCaja') .fadeIn('slow',function(){ }); if(msg=='error'){
Selecting all [name=] elements
Dear jQueryHelp members, I am working with jQuery for a few weeks and it's functions and selectors are really amazing. But now I have a problem, I have a HTML/PHP page with multiple $("[name=reis_id]") elements (input fields with reis_id as their name). And I need to select all [name=reis_id] elements and get there their val() / values stored in variabeles. I now have this, var test = ($("[name=reis_id]").val()); But this only returns the val() of the first element on my page. I guess i need to make
[jQuery] jqModal rebind after reload
Hi, I'm using a standard jqModal thing. It works ok until after I reload the tab with an AJAX call. Then the .jqModal elements are not bound. The question is how to re-bind them again? I've tried $("#box").jqmAddTrigger(".jqModal"); but it didn't help. And when I try to re-init the box with: $("#box").jqm(); after the ajax call, I get an error: H[this._jqm] is undefined Any ideas? thanks!
[jQuery] How to replace hardcode_value in jquery library
Hi all, How to replace hardcode_value in jquery library with something more flexible value (for example something value from html document)? For example I'd like to substitute the "hardcode_value" (in jquery file) with the value "input1" (in html document). thanks Antonio "html document" <div id='contactForm'> <a href='#' class='contact' value='input1'>Demo</a> </div> "jquery documetn" $(document).ready(function () { $('#contactForm input.contact, #contactForm a.contact').click (function (e) { e.preventDefault();
[jQuery] how to get a row of a table sorted with quicksearch plugin in a text box
Hi, first sorry for my english, but I'm speak spanish. my problem is that I don't know how get a data of a row and passing the result to a textbox located in my form for example : textbox.Text=(result); If somebody can help me.. thanks p.d: I use this jquery plug-in http://rikrikrik.com/jquery/quicksearch/#download
[jQuery] Problems with JQuery Cycle Plugin and IE6
Hi, I am having a problem with IE6 and the cycle plugin. In IE6 it shows a black background over my div background image (I set via css a background image to a master div). cleartype set to false, cleartypeNoBg to true. I am cycling transparent png images. In IE7+ and Firefox everything is ok. Any tip? Thanks Chris
[jQuery] Problem getting selected value from drop-down
Hi, Can anyone help with the following? With JQuery, I can't successfully grab the selected value from a drop-down. The alert just shows an empty message. At least it is not showing undefined (as it was for my other attempts - you can see what these were from the commented out code), but I would expect it to display one of the values One-way, Reciprocal or Other. Perhaps I have to do some conversion on the result. Your contributions to this post will be greatly appreciated. In my HTML I have: <select
[jQuery] dealing with a post (json) callback
hi, in firebug my callback data(object) is like so: [{"product_brand":"Creative Recreation","product_name":"Cesario Hi","product_slug":"CRM-CESAR-PRIME- HI","product_active":"1","product_description":"mens- red"}] i have never noticed the square brackets before ... but when i attempt to use each to oterate through the obnject for values... i get nothing: var obj=eval('(' + json + ')'); console.log( obj ); jQuery.each(obj, function(i, val) { if (i) { alert(val); jQuery('#'+i).append(val); } }); this
[jQuery] jquery not showing an iframe
I have been able to show iframes with jquery easily, but for some reason I cant this one to work. I am using the same exact setup in the same page to show this one, but it is not working like the other three. I need the iframe to fadeIn once an image is clicked. I have narrowed it down to class="artists" which in the css is set to {display: none;} without it there the iframe shows the entire time. With it there the iframe wont show at all. For the setup that does work I have: (I have two others with
[jQuery] Superfish with supersubs - won't auto adjust width
http://demo.ashwebthemes.com In the main navigation at the very top and the categories in the second level navigation. Can't get either of them to adjust to a proper width.
[jQuery] Problem how to set left value for top navigation menu
Hi All, I would like to ask how will I set the left value of my currently selected list. such that: var a = getViewportWidth(); var b = getMouseXPosition(e); var list_width = 150; var c = b + list_width; if(c > a) { //HOW TO: CODE FOR ADJUSTING LEFT VALUE OF SELECTED LIST }else{ //NO CHANGES TO BE DONE HERE. } [IMG]http://i605.photobucket.com/albums/tt139/borgymanotoy/problem.gif [/IMG]
[jQuery] Issue with setting click event functions in a for loop
I have a webpage that searches a database using a php script to search the database and a jQuery app on the page to retrieve the results and show them. So it works fine, but then I want to add page number buttons to allow the user to go to different "pages" of the results. So I have a DIV with the id of "page_buttons" and I use the following code: http://pastebin.com/m3dffbf99 I use the offset and the results per page like this in a MySQL query in the php script: SELECT .... LIMIT offset, resultsPerPage
JQuery validating with Firebug
When using JQuery in an app I am writing, (as the below shows), it produces several validation errors/warnings in the FireBug console. Is anyone attempting to fix these and/or can anyone help me fix these ? I'm no JS guru (just give me the API !!!), but I'm willing to help/test/code where I can. Firebug's log limit has been reached. %S entries not shown. Preferences reference to undefined property jQuery.cache[id][name] [Break on this error] script.appendChild(document.createTextNo...y(object[name],args)===false)break;}else
[jQuery] jQuery.Scrollable Navigation IE6 IDisplay Issues
Hi, I am trying to implement the visual example within IE6, i.e: http://flowplayer.org/tools/demos/scrollable/visual.html but unfortunately the navigation bar along the top does not display as a single row but as two rows of small circles. As mentioned, works great in FF but there seems to be an issues with the CSS when it comes to using it within IE6. Any help on correcting this would be much appreciated. Thanks.
Problem with Ajax Request and Escape
Hello. First of all, I'm German, so be warned ;) I've got a problem and my very hope are you guys (and girls). Here is my code I use to make a ajax request: $.ajax( $.extend(ajax, { data: { cmd:'ping', username:session.username, timestamp:ping.last }, error: function() { that.notifyPingingFailed(); }, success: function(data) { if(data.error) { that.notifyPingingFailed(); } else { that.notifyPingingFinished(loadResponse(data)); }
[jQuery] [validate] Validation by Remote: Passing in Data Alongside elementName
$("#Form").validate({ rules: { storename_name: { required: true, remote: { url: "/intranet/trunk/app/index.php/storeform/ findValidstorename", type: "post", data: { foo: "bar" } } }, Will this send the variable foo containing the value bar into the POST alongside the #storename_name
[jQuery] problem with horizontal menu style
I've just installed this extension, but i'm having some problems. Need to implement a horizontal menu style in user4, or user 3 positions on rhuk_milkyway template. When the menu drops down, it's not visible. what can i do? Thanks and regards Rui
[jQuery] Repeating userCollapseText
Hi! I'm using jquery.expander and I'm getting twice the userCollapseText value ( [collapse all][collapse all]). You know why??? Jorge.
[jQuery] [validate] editing the error messages
I want to make my error messages position absolutely so they do not resize my form when they appear. The problem is the parent of all the label.error is the form so when I do label.error { position:absolute; background:url(images/ validArrow.png); width:300px; color: red; left:300px; top:10px padding: 0px 0px 20px 50px; } they all stack up on top of each other is there a way to make them children of the label or the input? <label>Company Name</label> <input name="companyName" id="companyName" class="required"
[jQuery] .ajax GET not working correctly at webhost
I have this snippet: function ajaxAdd() { $('form').submit(function() { var nick = document.register.nick.value; $(':submit', this).attr('value', 'Adding...'); $(':submit', this).attr('disabled', 'disabled'); $.ajax({ type: 'GET', url: 'data.php', data: 'nick=' + nick, success: function() { $(':submit',
[jQuery] Problem jqm and $.get
hi, I am having problem when I use the $.get and jqm. I developed a easy example about the problem, you can download it from: http://cid-5c82aa0c9bbaf5b3.skydrive.live.com/self.aspx/Public/Forum/WebAppjQuery.zip When the example run, you can see a default.aspx page with two buttons. You need to press the LoadGrid button. When the grid is loaded at the first time you can press the cancel buttons and you will see a popup windows. But when you press LoadGrid button again, the grid will be reload but
[jQuery] Background color is being applied when using Cycle plugin
I've been using Mike Alsup's Cycle plugin on a large number of projects, and one of the most recent ones is giving me trouble in IE. In this example, the slide container seems to have a background color applied to it, and there is neither a background property added to it nor is there any background property in the CSS for the slide element or its children. I finally decided to recreate the effect from scratch to make sure it wasn't some strange IE bug or the markup, and the from- scratch version
Inline javascript while using load()
I have been going insane trying to figure out how to make an inline JavaScript work from a load(). I would usually just avoid using the inline script, but in the case it is necessary. I am using my load like this: $("#content").load("index.php", { id: GETid }); Some of the loaded content contains necessary inline JavaScript, but it's not showing through. Any helpful solutions?
[jQuery] Asynchronous page loading + slide!
Hey guys! Im trying to use jquery to try to do what the image shows: Its for a website made for iphone so im trying to add the slide effect. It all seems a little complicated, but ill explain: 1-The user clicks a link 2-A loading message (or image) appears -------> Meanwhile, the new page loads on a hidden side (its a FULL page, not just a div!!!) 3) The page ends loading Old page slides out to the left <-------------------- 4) It slides to the left its now hidden I want to do this without a page
[jQuery] jQuery iPhone Flick Action (for mouse)
I've been looking for a plugin to be able to use the mouse and eventually the iphone to flick and navigate through a page. Does anyone know if there are examples that exist currently. I think i'd probably have to implement it using the scrollTo plugin to do the scrolling. With luck i was able to find that there is an iPhone only flick type plugin already written but nothing yet for the mouse. Anyone have ideas?
[jQuery] Odd overlap issue with cycle plugin
I have a slideshow set up here, for reference: http://www.littlerobothead.com/secret.php You'll be able to see the slides as they overlap when using the "next" or "previous" buttons. The CSS that controls the slides themselves is: #top-feature { /* this is the parent container */ height: 300px; padding: 20px 0 0 0; border-bottom: 2px solid #452219; background: url('/images/1.jpg') top left repeat; overflow: hidden; } .slide { /* this is the child class for slides */ width: 700px; margin: 30px; padding:
[jQuery] jQuery Media - won't autostart an mp3
I need to play an audio file in response to a user action. The player must be completely cross-browser compatible, and hopefully use an available plug-in. jQuery.media seems to be the ticket, but while I can get it to work in manual mode, it doesn't autoplay for me. This may be a problem with player.swf, not jQuery.media(), but this test page: www elearningcorner com / products/media/index.htm shows the problem. The rendered html (viewed by Firebug) looks good to me: <embed height="400" width="400"
[jQuery] Odd overlap issue with cycle plugin
I have a slideshow set up here, for reference: http://www.littlerobothead.com/secret.php You'll be able to see the slides as they overlap when using the "next" or "previous" buttons. The CSS that controls the slides themselves is: #top-feature { /* this is the parent container */ height: 300px; padding: 20px 0 0 0; border-bottom: 2px solid #452219; background: url('/images/1.jpg') top left repeat; overflow: hidden; } .slide { /* this is the child class for slides */ width: 700px; margin: 30px; padding:
[jQuery] forms plugin: problem with $.get
Hello, i have no clue why it is like this, but in the following code, the "errors" variable doesnt count +1: $.get("functions/checkforms.php",{doesuserexist: loginusername, doespasswordexist: loginpassword}, function(data){ if (data) { $("#loginpassword_error").show().append(data); errors++; } }); Do you know how i can check if "data" exist, to set "errors" +1? Regards, Shade
[jQuery] Problem with Ajax Request and Escape
Hello. First of all, I'm German, so be warned ;) I've got a problem and my very hope are you guys (and girls). Here is my code I use to make a ajax request: $.ajax( $.extend(ajax, { data: { cmd:'ping', username:session.username, timestamp:ping.last }, error: function() { that.notifyPingingFailed(); }, success: function(data) { if(data.error) { that.notifyPingingFailed(); } else { that.notifyPingingFinished(loadResponse(data)); } } }) ); Don't wonder about the $.extend cause I make this kind of request
[jQuery] Animating the specific div youre hovering over, from a selection of divs with the same name
Hi All, I have 3 divs with the same name wrapped in a container. Each div includes a span. At the moment, when you hover over a div, its displays all spans. What i want is if you hover over a specific div, i would like to display it's span only. Is this possible ? <html> <head> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('.alert').hide(); $(this).hover( function () { $(".alert").show('slow'); }, function
[jQuery] Slide to fade, can you help me quick? Noob alert!
Hey guys, I'm building a site for the company I work at. I'm a pretty experienced web designer and coder (as far as standards compliant html/ css goes), but I'm a complete noob to javascript & jQuery, but I'm trying. I found this snippet of code online: $(document).ready(function(){ $(".loginToggle").click(function(){ $("#loginForm").slideToggle("slow"); }); }); Right now, as you can probably tell, when you click the link with the class .loginToggle it slides open the div with the
Datepicker on dynamicly created input
Hi, I'm using some javascript to generate multiple input text fields with the same name of additionalDate[] but cant seem to get datepicker to work on it. Here is the datepicker code: <script type="text/javascript"> $(function() { $("#datefrom").datepicker({ dateFormat: 'dd/mm/yy' }); $("#additionalDate").datepicker({ dateFormat: 'dd/mm/yy' }); }); </script> Here is what the input: <input id="additionalDate[]" class="myDate" type="text" name="additionalDate[]"/> Any ideas?
Animate passing variable
I am creating a sliding image gallery and am trying to use this line: $('#images_wrapper').animate({left:"-197px"},1500); This would move the entire div of images to the left but only works once. I was trying to put the current position-197 in there: var position = $('#images_wrapper').css("left"); position = position.replace('px',''); This would remove "px" and return 197. How do I place this variable in the upper jQuery statement? I've tried everything I can imagine. Thanks!
height() on youtube embedded video always returns 18px
Hi I'm trying to find out the height of an embedded youtube-video (what I wan't to do is hide all embeds when I open a facebox and replace them with a placeholder of equal size). I (basically) tried this: $('object embed').each(function(i) { $(this).height(); }); It always alerts 18, at least for the yourubevideos I embedded.
Hovering over a specific <div>
Hi All, I'm new to jquery, so please be patient. I was wondering if someone could help me. I would like to know to to specifically target the action of a div that has the same name as other divs. I have 3 div's in a container, each called 'item' (<div class="item">). Each div has a <p> tag and a <span> tag inside. I have hidden the <span> tag initially, but would like to display the <span> tag of the specific <div> that I over. At the moment, If i hover over one div tag, it shows all spans tags for
Next Page