Jquery Selector Bug :even :odd?
Sorry, i don't speak english. I have found the following feature with jquery selectors ':odd' and ':even' on zebra tables. My table: <table border="0" class="tbl-zebra" cellspacing="0" cellpadding="0" width="100%"> <thead> <tr> <td>Table head</td> </tr> </thead> <tbody> <tr> <td>Lorem</td> </tr> <tr> <td>Ipsum</td> </tr> <tr>
Calling Function inside an iFrame
Hey guys, How do you call a function inside an iFrame using jQuery? function MyFunction() { alert("Test"); } Javascript - works var f = window.frames.myIFrame; f.MyFunction(); //works jQuery - fails var $f = $("#myIFrame"); $f.MyFunction(); //fails $f.contents().MyFunction(); //fails Thanks!!
how to get jquery $.post variables via php $_POST?
Hi, I have php and js code. In JS part there are some variables set, when user selects options, and I want to get them in PHP. So I used jQuery "$.post" function, like this: $(document).ready(function() { $.post("my_page.php", { product_t: "29"}, function() { alert('Your data has been saved.'); }); }); What I am going to achive is to get variable 'product_t' in PHP. So I was expecting to have it in $_POST['product_t']; but it's empty:( Where
Change event only fires once
Hi, I am a seasoned PHP developer and I'm also very familiar with xhtml and css. I've been playing with jQuery for a couple months and to this point it has been pretty easy to pick up. However, I have run into my first roadblock and I'm hoping someone is able to lend a hand. I have a series of checkboxes on a page and the goal is to run an ajax post each time one of the checkboxes is checked. When the page loads, the first time I click each of the checkboxes everything goes as planned. After
clone(), clear values?
I have a div structure with input elements like this: <div id="categories"> <div class="elements"> <input type="text" name="v1" class="myclass" /> <input type="text" name="v2" class="myclass" /> <input type="text" name="v3" class="myclass" /> </div> </div> <a href="" id="add_newitem">Add New Item</a> I clone the div 'elements' and put that back into the div 'categories' like so: $("#add_newitemr").click(function() { $('.elements').clone().appendTo('#categories');
Weird random behaviour in Safari (and possible other browsers too)
I have been trying to find a solution for this for a couple of months now, but still haven't been able to find out what's wrong, so if someone could help me out I will be forever greatful! Problem is I have a (rather complex) web page with lots of jquery javascript. It works perfectly about 50% of the time. The other times it will display parts of javascript code printed in the web page or parts of html tags in clear text. It never happens if I turn Javascript off, so my best guess is that jquery
Ajax success Callback in Firefox4
Hi, today I updated my Firefox from 3.5 to 4.0b3 and it seems that the AJAX success callback is not longer fired. Firebug shows the correct response but the function is never called. Is this a Problem of the FF Beta, or is Jquery responsible for this? Here is my Script $.ajax({ url: 'ajax.php', success: function(data) { console.log('success'); } }); Best regards, Elmowater
Scrolling list with hoverIntent
Hi, I am fairly new to jquery and have found 2 useful examples for the effect I am trying to achieve. The basic idea is to have a scrolling list that when you hover over an item the other items in the list fade out and the scrolling is paused. The below code almost achieves this however the hover function is not consistent and the scolling doesn't pause. If anyone could take a look at this and point me in the right direction it would be most appreciated. The hover feature makes use of this plugin
Can I contribute to tutorial documentation section ?
I'm very sorry if this question is OT, but I can't find a discussion that fits the question. The fact is that I posted 2 tutorials for beginners in italian language, in my blog... I wondered if can be listed in the italian tutorial documentation section, but... although there is the edit button, the subsequent login page does not give me the possibility to sign-in, but only to log-in. in the italian tutorial link list there is a bad/fake link, called Cardboards and, as you can see, it points to a
Providing jquery header files through ajax: can it work ?
hi The framework I use can sometime contribute the jquery header files, like <script id="" src_="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>, though ajax, thus well after page load. However, this doesn't work: any jquery code executed afterwards fail, for example with "$ is not defined" and sometimes, with some plugins, in a worse way is there a way to initialize jquery in this use case ? thanks in advance herin
Show lists with less than 2 elements and hide with more than 2
Hey guys, i've got a question. I would like to show childlists in a sidebar which have less than 2 elements in it, and hide childlists which have more 4 elements in it. this is what i got til now: $('.sf').children('li').children('ul').length <= '2'){ $('.sf').children('li').children('ul').show(); } but with this code, all childlists will be shown. i hope you'll helpin' me soon thanks derHINDU
Help with parseDate utility...
Hi, I'm fairly new to using jQuery. I'm trying to omit dates from a datepicker calendar. I want to omit dates by using 3 separate formats: (1) day of the week (2) specific date (3) date range Each format above can have multiple instances, for instance, I can have all Tuesdays and Wednesdays blocked off along with a specific date and a few date ranges. $(function() { $("#datepicker").datepicker({ dateFormat: 'yy-mm-dd', numberOfMonths: 3, showOtherMonths: false, changeMonth: false, changeYear:
Mouseover not responding to first event.
I have an image that I'd like to trigger a show/hide action on the mouseover event. However the mouseover (tried mouseenter too) doesn't get fired on the first mouse over. It does get fired on the second mouse over and works as intended from that point forward. Has anyone seen this behavior before? http://aharris-dev.globworld.com/?user_id=91# Is the page I'm trying to work on. It's the unloaded image next to the text box. Any help with this would be appreciated. $('.header_status_avatar').live('mouseover',function()
jQuery Noob - General approach to task at hand......
Hey All, I am a seasoned flash developer diving into the world of jQuery and css and am being tasked with converting an old flash piece to jQuery/css execution. I have been plugging away and making progress however, it's been a bit of "1 step forward 2 steps back". 1. Basically what I have is a 4 image slide show. 2. Each slide contains a button [with it's own rollover effect] that users could click to dive deeper into the site. 3. There are 4 thumbnail images below the slide show the user could
Javascript startsWith() help
This code is not working. I don't know much about Javascript but I am trying. The startsWith() function is what I added to the code and it killed everything. What am I doing wrong here? var idToShow = location.pathname.split("/")[1]; if (idToShow == "index") { $("#home").show(); } else if (idToShow.startsWith("_webapp")) { $("#district").show(); }There is obviously more to this but hopefully you will be able to see what is wrong here. When ran it completely kills my code. Thanks! Austin
Hyperlink Issue
experts, I am trying to figure out how to fix a hyperlink on a page. I can not customize the page but I can add JavaScript. When a user clicks this link they are naviagted away, when they hit cancel on that page it does not bring them back to source address. Is there a way I can add a reference to the source address to force it to return. http://.../.../.../MSL/Lists/MSL/DispForm.aspx?ID=42&RootFolder=*
Ho to simulate a right clik (contextmenu) event ?
I use the plugin jquery.contextMenu.js to open a custom popup menu when a user right click to a specific html element. Nox, I want to show this popup menu when a simple onclick event occurs in a specific element. I have see that JQuery propose trigger method but there is no oncontextmenu event ! How can I do ? Thanks for help. Sam
plugin to make table columns expandable
Is there any plugin which can make any given table column widths expandable ?
.get() vs. .ajax
Why would I use one vs. the other? I think just .ajax is the way to go as it's just got more options. Is one newer and better supported or capable than the other in making calls to get back XML?
jQuery.ajax() problems - timely response needed
Hello, I am using jQuery for the first time for my new job. I'm currently working on building a Twitter integration where I call the Bit.ly API and shorten a URL. Here is my code (that literally was working a few days ago): jQuery.ajax({ url: "http://api.bit.ly/v3/shorten", data: { longUrl: url, login: "removed", apiKey: "removed", format: "json" }, async: false, dataType: "json", success: function (data) { if (data.status_code != 200) { alert ('There was an error, please retry construction of the
Create personal scrollbar
Hello, I want to create my own scrollbar with a background image which works with the mouse's wheel only, I have found lots of demos of customize scrollbars but they all work with the event click. Help me please, any idea is welcome !
selecting a class within an element
hi guys, I need to select a class within an element. the class is generated by the code using .addClass. I suspect this is actually really easy and I'm just being stupid, but any help would be greatly appreciated!
Coda like popup, multiple use?
Hi! I found this: http://jqueryfordesigners.com/coda-popup-bubbles/ and was thinking about implementing it on one of the sites im developing right now. The only thing is, it's only usable once per page and I was kind of hoping i could use it more than once. Is there a way of changing this? I don't know how to myself, so I would be extremely thankful if someone out there could help me! Thanks in advance!
Contextually aware jQuery code completion editor
Does anyone have a fav editor that does jQuery code completion?
animate() problem mouseOver
I have a simple slide news when the mouse is over the region news, the slide is slowed when the mouse leaves the slide is walk. Look at the example http://apex.oracle.com/pls/apex/f?p=27825:2:1085294691745502::::: My problem is when the mouse goes outside the region news
Center text during JQuery animation
Hello, I currently have a very simple animation that increase the font size of a text as if you are running a magnifying glass through it. The only problem is it increases from the upper left corner, whereas I would prefer it to increase from the center. Here is a link to where the code currently is: http://jsfiddle.net/hdnUB/ I don't want to hack it by changing the position of the text during the animation, then changing it back post-animation, but I that is the only way I can think of. Any suggestions
Cardswiper data into hidden inputfield
Hi guys I've just gotten a MagTek cardswiper in the door. It works exactly like a keyboard. Once you swipe a card through it it just writes in the text string from the card onto where ever focus is for the cursor. So if you have MS word open it writes it there or if you have notepad etc. I have a webpage where a user needs to write in some personal data every time a new client is created in the system. Here is where the cardswiper comes in handy. Once the user of the website is on my create new user
.html() return different values in chrome and in other browsers. jquery bug?
.html() returns different values in chrome and other web browsers when the html tag has an inner <CDATA. example: <p style="display:none"><textarea id="template" rows="0" cols="0"> <![CDATA[ {#template MAIN} {#foreach $T.children as node} <p> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx </p> {#/for} {#/template MAIN} ]]> </textarea></p> script: $('#template').html() In chrome return: <![CDATA[ {#template MAIN} {#foreach $T.children as node} <p> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
AJAX .load() function not working in onclick in FF and IE
For some strange reason the load function is not working in FF and IE but it does work in Safari. <a href="javascript:$('#id').load('url')">Link</a> or <a href="javascript://" onclick="$('#id').load('url')">Link</a> or <a href="#" onclick="$'('#id").load('url')">Link</a> If I put an alert() or a console.log() before or after the .load(), the alert() or console.log() is triggered but the .load() isn't. In Safari all methods just work.
Select checkbox by checkbox/radio button
Is there a pluggin or example i could use for selecting checkbox by selecting other checkbox or radio buttons? I have sets of checkboxes and radio buttons as the search criteria and another set for the search result. Basically what im trying to do is for each criteria, select search results by checking the checkbox. Thank you
jquery autocomplete + clone
I have an input field in my page with autocomplete on it. The autocomplete works great. There's also a link beneath it which clonse the textfield. When i try to enter a new value into that it doesn't show the autocomplete list anymore...?? Anyone any idea how to solve that problem??
problem with children() and attr('title')
I want a value out of my title attribute in my table. But it won't work. Here is my code: $(tr.artikelDump).children().children('.aantalDump').attr('title');This I use to get my title attribute out of my class aantalDump. But it is empty. Here is my table where I try to get the title value from: <table> <tr class='artikelDump'> <input type='hidden' class='bestelid' value='1' /> <input type='hidden' class='artikelid' value='555' /> <input type='hidden' class='leverancierid' value='26'
Problem adding the datepicker to a dynamically created text box
I have an HTML table into which I dynamically create table rows, and each table row contains a single column holding a dynamically created INPUT box to which I attached the Datepicker control. My problem is that when I do so it is incredibly slow and when the table contains more than approximately 100 rows, the script stops working. I am clearly adding the control incorrectly; can someone look at the following HTML code and please tell me what I am doing wrong? HTML start ================================================================================
how to change values returned by JSON hash
All of the following works fine - except when I put in the switch() to adjust a value returned $.getJSON( urlCalled, parametersUsed, function(dataReturned) { pj= dataReturned; var a = pj; jQuery.each(a, function(n) { var v = switch(a[n].value1) {case 'YES':'Active' break case 'NO':'Inactive' break}) + ' ' + a[n].value2; alert(v); }); Help with syntax or do I need
Load() issue and script getting disabled?
I followed a simple example on the jquery site where I load a html page inside a div. The page does load inside the div correctly however what i noticed is that the page that loads inside the div, its jquery scripts don't work. . when i call the page by its own the jquery scriptes work: code in js file: /* Loads the default contact page inside the content div using the jquery ajax api */ $(document).ready(function () { $("#showcontactusform").click(function(event){ $('#contentdetails').load('/contact/contactform1.html');
fadeto() not working?
hey, I am not very experienced with query which is why i am asking for some help. i am creating my portfolio website and i want to use jquery to fade out thumbnails. I have categories of projects in a <ul> Print, Web, Illustration, Photography and when u click on one list item, i want it to fade out all the thumbnails that aren't print (for example), so only the print related projects are full opacity. Here is my code. <script> $(document).ready(function() { $(#printbutton).click(function () { $(.photo
button wont work on IE after updating validation code
Hi, After adding some lines of validation from Jorn's validate plugin, the addcar button on IE suddenly won't work, then safari is working, but not displaying updating properly after the animation, it will appear as if broken, but if you scroll up scroll down, then it would update Chrome and firefox is okay. Here is the button click code $('#addvehicle').bind('click',function() { //ajax $.ajax ({ type: "POST", url: "addmorecar",
Change an image when fields are validated
I'm quite the novice here and hope someone might be able to help me. I have a form with a username field and password field, and a login button in the form of an image. I would like to have the login button image change its state to the hover style in the CSS when both username and password fields have been validated/filled out. Thanks! /** Button CSS **/ input.button{ background:url(images/loginbtn.png) 0px 0px; width:92px; height:31px; border:0px; float:right; margin-right:20px; margin-top:5px;
validation plugin two fields as one
Hi, I'm using the validation plugin by jorn, but I kinda needed to validate two text box, something like a serial number XXXX-XXXXXX So I separate them into a text box. [Textbox(XXXX)]-[Textbox(XXXXXX)] How do I make it work as one validation? Thanks
callback function doesn't execute
$("#scroll").hover(function(){ $(this).find(".front").stop().animate({ top:"184px"},500,function(){ $(this).find(".front").stop().animate({ top : "7px"}, 300); }); }); I'm newbie in jquery. I try to make a scrolling picture. when mouse roll over the image with .front class will scroll down, but it has to come back after mouse roll out. the scroll down is working but I wrote a callback function,
Next Page