[jQuery] Add a class only to the first parent
Hi all, I need some help, I want to apply a class with 'addClass' at all <li> of the first <ul class="menu"> and not to the second Example: <div id="foo"> <ul class="menu"><!-- first --> <li>1</li> <li>2</li> <li class="expanded"> <ul class="menu"><!-- second --> <li>3</li> <li>4</li> </li> </ul> </div> How can I achieve this? Is possible without using the each() function? Any help, suggestions, examples are welcome. -- Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/ "It's easier
[jQuery] A better way to do this?
Hey All, What's a better way to write: $(this).children('ul').children('li').children('a').each(function() { // Stuff here... }); I tried: $(this).children('ul > li > a').each(function() { // Stuff here... }); But its not returning the correct results. Im sure this is easy, could someone point me in the right direction? Cheers, Dana
[jQuery] Sortables Update Still Showing Old Sort Position (With New Position)
Here's the code: $("#sort1").sortable({ connectWith: ['#sort2', '#sort3'], revert: true, items: '.groupItem', handle: '.itemHeader', placeholder: 'moduleSortHelper', start: function(e, ui) { ui.helper.css("width", ui.item.width()); }, update: function(e, ui) { $("#sort1").sortable("refreshPositions"); alert(ui.item.find(".moduleId").text()); $("#sort1").find(".groupItem").each(function()
jqery.height() returning no value in IE
I am trying to use jquery's .height function to dynamically size a <div> so that it sits just above the bottom edge of the user's screen, and taking into account 210px of padding from a banner at the top of the page. I am currently using this code: <style> .cart{ background:#66FFFF; position:fixed; width:20%; height:100%; right:10px; top:190px; } </style> <script type="text/javascript">
[jQuery] [validate] Form doesn't show in IE
I'm using jquery with validation and form plugin. All my forms works in FF, but in IE the site is blank. URL: http://test.mittskift.no/ Click on "Kontakt oss" in the top-menu.
[jQuery] attr('onclick','') problem on ie6
Hi, i'm new to jquery and i'm having some problem. the code below works fine in FF3.0 but doesn't work with IE 6.0. i used it to show and hide table row when user click the show/hide icon id and a_id are dynamic ids. id will be something like #23, and a_id like #id_23 function show_hidden_row(id,a_id){ $(id).show(); $(a_id).removeAttr("onclick"); $(a_id).attr("onclick","hide_shown_row('"+id+"','"+a_id+"')"); $(a_id).html('<img src="images/minus.png" alt="hide" border="0" />'); } function
[jQuery] jquery is not defined (newbie)
I am trying to get datepicker plugin (http://eyecon.ro/datepicker/ #about) to work on a page, and I can't get it to work for some reason. I keep getting the following 2 errors: jQuery is not defined datepicker.js()()datepicker.js (line 819) [Break on this error] })(jQuery); datepicker.js (line 819) $("#inputDate").DatePicker is not a function [Break on this error] onChange: function(formated, dates){ I'm positive that the paths to jquery, etc.. are correct. This is the code I am using to call the
[jQuery] Check checkbox based on ID list
I am looking for ideas on how to check some checkboxes based on a list of id's that match the id's of the checkboxes. Example: <div id="checkedValues"> 10, 14, 11 </div> <div id="checkBoxes"> <input type="checkbox" value="1" id="10" name="10" /> <input type="checkbox" value="1" id="11" name="11" /> <input type="checkbox" value="1" id="12" name="12" /> <input type="checkbox" value="1" id="13" name="13" /> <input type="checkbox" value="1" id="14" name="14" /> </div> In this example, when the page loads,
[jQuery] jQuery 1.2.6 event.altKey is undefined
problem: event.altKey is undefined. environment: Linux/ FF 3.0.1 / jQuery-1.2.6 remark: when I am using older version (1.1.4) everything works fine. The following markup along with firebug will be handy to capture it. <html> <head> <script src="http://jqueryjs.googlecode.com/files/ jquery-1.2.6.js"></script> <script> $(document).ready(function (){ $.event.add(document, 'keydown', showEventDetails); }); function showEventDetails(event){ console.log("Alt:%s", event.altKey); } </script> </head> <body>
[jQuery] Getting name of element in $.each, when used on object?
<div dir="ltr">Hey Folks, Probably a rather basic question here, but my attempts at figuring it out have come to no success. I'm using $.each to loop through the attributes of an object, and write them out into a string. The object contains a series of parameters that will be passed through a url (for a geoserver WFS should anyone care). Is there any way to get the name of the attribute so that it can be used as a string? Mockup object: { request: "getfeature", typename: "massgis:TOWNS",
[jQuery] Cache problem
My js files are being cached as HTML Documents instead of JScript. And this I causing, I believe, all of my pages to load slowly. Is there any reason why js files would be cached as HTML? How can this be fixed? Thanks for any help.
[jQuery] nth-child() vs. even/odd
Are they equivalent to each other? Ignoring the fact that one is counting from 0 and one from 1. This does not work (use the same CSS class for subsequent rows): $("#tableid tbody tr:even").addClass("even"); $("#tableid tbody tr:odd").addClass("odd"); But this does work: $("#tableid tbody tr:nth-child(even)").addClass("even"); $("#tableid tbody tr:nth-child(odd)").addClass("odd");
[jQuery] Issue Related to Interface.js plugin with on jQuery 1.2.6 in Internet Explorer.6
Hi, I am planning to use Interface.js (http://interface.eyecon.ro/) as we have some requirement as in we have to create portal having portlets and also supporting drag and drop , this is where I see interface plug providing me all that I need. Now the problem :- Interface.js works on jquery 1.1.2 but fails when used with jQuery 1.2.6 in Internet Explorer 6. Drag and drop works but once a item is dropped it can not be dragged again in IE-6. (check the demo related to "sort" on http://interface.eyecon.ro/
Overwrite CSS :hover with .hover doesn´t work
Hello everybody, I hope someone can help me with a little problem. I´m looking for a way to overwrite the :hover styles given from a css-file. My page includes a menu working without JS very well, but I want some special effects for users with enabled JS (fadeOut). The problem is that when I create a .hover method in jQuery, the CSS :hover is still active. A short example, to clarify: CSS: li > .submenu { display: none; } li:hover > .submenu { display: block; } jQuery: $("li").hover(function()
[jQuery] Interface plugin SortableAddItem on dynamic content...
hey guys, been trying to make this work but haven't been successful yet, I was wondering what I was doing wrong... basically I have a div groupWrapper where all of my "items" are contained and whenever something is added it's appended to the groupWrapper The problem is that only the first item is draggable, but I can make it switch places with all of the other items. this is what my items look like <div id="question{0}" class="groupItem"> <div class="itemHeader"><h2>Question {0}</h2></div> <div
[jQuery] jQuery countdown
Hello, I am unsing the pluging http://plugins.jquery.com/project/countdown but when i include it into my site he adds enter above and after the div. This is how i use it: Je mag weer spelen over <div class="countdown" secs="{$error}"></div>! With this result: Je mag weer spelen over 00:24 ! How can i edit it so that there aren't any enters around it? Thx, Erwin
[jQuery] autocmplete working ( kinda)
I finally am beginning to understand some of this. It took a little bit for the fact that variable "q" was being passed and not the id of the input element. And it's right there in the documentation. I've tested my query and it give the results I want. But the results passed to the autocomplete are strange. If I type "charles w" I get "Charles Wade" but there are 7 more matches in the backend query. And, following the one item returned, I get code like; .debug { color:black; background-color:white;
[jQuery] Simple syntax help please!
I'm trying to set up a 'mailto' href within an existing tag. The tag is set up to look like this before the jQuery <a href="#" mLink="partners" mSubject="Partnership Enquiry" mText="Click to enquire"></a>" Our site is aliased to several domain names, the main point of the exercise is to construct the link to reflect the domain name used to reach the site - but as there are several such links, I'm hoping to generalise the content of the link elements too, by making it possible to only
[jQuery] Safari 3 working locally but not on the web.
Hi everybody, I'm new to jQuery and to web developing in general (I guess). context: Recently I developed a website on a Mac using MAMP and Firefox. I used MySQL, PHP and javascript (jQuery-1.2.6 --> for effects and ajax). I'm also using these plugins: - thickbox by Cody Lindley - livequery by Brandon Aaron - timer by lisaplugins - pagination by Gabriel Birke - cookie by Carhartl problem: Everything works fine using Firefox (on mac and windows). And everything works fine using Safari locally. So
[jQuery] Needed link | Jquery simple Dropdown menu
Hi All, I am new to jquery a learner. I was just going through the sites for simple jquery menu. But everywhere i am finding accordion menu. I dont need that. Can anyone please help me out with this? any code or link? Thanks & Regards Sridhar k n
How do I cache a page once it has been loaded via AJAX?
How do I cache a particular page that has been loaded via Ajax GET request. I want it to stop the GET request after it has been loaded and simply show data onclick. I set the cache setting to 'true' and it still calls the request. What am I doing wrong? <a id="myLink" href="javascript:;">My Link</a> <div id="myContainer"></div> <script> $(document).ready(function() { $.ajaxSettings.cache = true; $('a#myLink').click(function(){ $.ajax({type: "GET", url: 'myPage.jsp', cache: true,
[jQuery] Minimizing jQuery library
I would like to minimize the size of library file to minimum with my specific wanted functionalities. All what I need is selector for ID, html function, ajax call, element toggling and sliding (slideDown). What size of library do you think could be the minimum in my case (minified version). I have no experience with rebuilding libraries. Thanks and have a nice day.
[jQuery] Control the execution of successive ajax calls !!!
hello, I have a request to make two ajax calls (two different requests), but the call back function for both the ajx calls is same.My requirement here is, i do not want to trigger the second ajax call till the first ajax call and it's success function are completely executed. I short, i want to control the execution of the successive ajax calls. Any ideas or pointers for the above question? Thanks, nit...
[jQuery] MultiFile plugin: Anyone know how to reset the form using javascript?
Hi there, anyone using the MultiFile plugin can drop me a line, please? How can I reset the form? Thank you!!
[jQuery] Question about ajaxSubmit
I'm new to the group and to JQuery, but am currently reading and writing a review of JQuery in Action. I have an interesting problem; I'm hoping someone can help me with it. I have a form that posts to a server. When the post executes, it always receives a redirect. What I want to do is capture that redirect, determine whether it is an HTML page or a PDF document. If it is an HTML page, I want to display it in the same window/tab. If a PDF document, I want to change the target for the GET (the redirect)
[jQuery] Question re: jQuery QuickSearch
<div dir="ltr">Hello world! I am a new member and really really new with jQuery. Although I have seen this work so many times before, this is the first time I am actually using the codes. Anyway, I am trying to make Rik Lomas quicksearch plugin (<a href="http://rikrikrik.com/jquery/quicksearch/">http://rikrikrik.com/jquery/quicksearch/</a>) to work. The problem is. I don't know how. There was actually no clear explanation or tutorial on how to implement it. I tried adding a form with the id="quicksearch"
jdmenu plugin: how do I make it a right to left menu ?
Hi, I've chosen jdmenu plugin for a horizontal menu for a website I'm building (any other jquery recommendations for a dropdown menu?). Now, I would like to use it for a right to left horizontal menu. Can anyone tell me how to do it ? Thanks a head, Yair.
[jQuery] .click( ) event causes anchor-like jump
Hello Everyone, I am creating a .click() event for a TR, and then i show a row that is corresponding directly below it. The problem is that when the event fires, the browser jerks down as if the TR i clicked on was an anchor and goes to the TR. I do not want any behaviour like this, I just want it to open and the browser to stay looking at what its looking at. Code is as follows: $(".event_heading").click(function(e) { e.preventDefault(); e.stopPropagation(); //Get the
[jQuery] [Validate] How to specify location for error message ?!
Hi everyone, i'm having trouble with the jQuery Validate plugin. I easily find how to validate my form, but i would like to specify location for every error message the validate plug-in send. But i don't find, i think it's withe the option "errorPlacement" but i don't know how to use it exactly. Here is my code : $(document).ready(function(){ $("#News").validate({ rules: { TitleNews: {required: true,minLength: 10}, IntroNews: {required: false,minLength: 150}, ContentNews:
[jQuery] alternative to timers.
One of the functions of the website i'm building is a live chat. The way I've implemented it so far is that every 2 seconds I send an ajax request that will get the 15 most recent posts (even if there weren't any posting during those last 2sec). I find it really inefficient. Is there a way to update the chat every time something is added to the database (mySQL)? I find timers really hard to work with. Is there an alternative to it? (i'm currently using the timer plugin developed by lisaplugins ---
.post
I am using the ajax call .post to update content on my page when a user clicks a certain option. My javascript looks like this: <script type="text/javascript"> <!-- $(document).ready(function () { $.post("portfolio-ajax.php", function(data){ $("#mainContent").html(data); }); $(".button").click(function () { $("#mainContent").fadeOut("fast"); var pid = $(this).attr("id"); alert(pid); $.post("portfolio-ajax.php", {portid:pid}, function(data){
[jQuery] Thickbox iFrame, 3 links, need box to close and refresh parent page
Hi, I am using thickbox to show iFramed content. The thickbox iframe appears with 3 links inside. When a link is clicked the thickbox should disappear and the parent page should load the link. Currently the link loads inside the thickbox window. I do not want this. Is there an easy way to have the link load in the parent page and have the thickbox go away? Thanks for any help.
[jQuery] XML Parsing: Getting a node value
I have the following XML File: <A> <os:TestTag>10</os:TestTag> <B>JSHDHSKJAD</B> </A> I want to get the tag os:TestTag value. I am using the following query (This XML is in xmlDoc variable). $("A", xmlDoc).find("os:TestTag").text(); The above query is not working, So I tried the below one: $("A", xmlDoc).find("TestTag").text(); But no use. How can I get that node value?
[jQuery] Adding Next link and Prev link To the first and last image
Hi all ! everything is in the title. I would like to Add Next link and Prev link To the first and last image of the thickbox plugin. Any ideas would be helpfull ! Thanks a lot ! Gabriel
[jQuery] FF3 +jquery 1.2.6 + thickbox + custom plugin issue
Hello! I have a strange issue, since Firefox 3 came up: i use thickbox to launch a page inside a modal window. On this page runs a custom plugin that resizes automatically a div to the available window height. I then use jscrollpane to have a good looking custom scrolbar appended to that div. What happens now is that on page load the new height calculation amounts to 0. If i refresh the page, then the height is correctly evaluated. Here is the plugin i made, can someone help me find and correct the
[jQuery] creating and inserting a new element fails in IE7
Hi! The following function converts buttons dynamically to links (so I can format the links with CSS later) Works fine with FF3 and Opera. But in IE7 the <a> element does not get inserted and I have no clue why!? In IE7 it seems to fail in line var c = $ ('<a>').insertAfter(this).addClass(this.className).attr('id',this.id +'_r'); my javascript debugging capability in IE7 is limited but this <a> element never shows up according to all my DOM inspections. Any help from a professional is desperately
[jQuery] History plugin not getting back to the home page - Link Inside
So I have managed to get this working ok but the problem I have is I can't get back to the home page. I have tried to solve it for a while but can't seem to come up with a solution. Has anybody got any ideas? http://tinyurl.com/39exv6 Link to javascript file: http://tinyurl.com/64zdw5
[jQuery] jscrollpane and tab key
hello, i got a problem while loading a form into a container using jscrollpane to handle overflow. First time it's loaded jscollpane reacts like it should do, but if u use the tab key to go through inputs and textfields, jscrollpane disappears if the form is much more longer than the div container. does anyone of you have/had the same problem and a solution for this issue? Please help me, thnx in advance
[jQuery] Script Wouldn't Work After Content Reloaded
Hi all. I've tried to reload a content using jQuery.post. However, it seems that once the content is reloaded, the script didn't work the way it supposed to. My jQuery script is: $(".click").click(function() { alert('Hello World'); $.post('actions.php', {}, function(data) { $("#new").html(data); }); }); Content for actions.php: echo '<a href="#" class="click">Click Me Again</a>'; As for the HTML: <div id="new"> <a href="#" class="click">Click Me</a> </div> On first click, the script will work. But
[jQuery] div magic
I'm very new to jquery and I'm finding that I'm flooding myself with ideas of how to use it! Good stuff. I have this repeating pattern on my site: <div class="box"> <h3>Some Neat Title</h3> <div class="boxContent"> Some neat content... </div> </div> What I think would be cool is to change that to the below and just put some script in my site's startup script that looks for all divs with the class "box" and modifies them so the ending result is like the above. <div class="box" title="Some Neat Title">
Next Page