how to make a:hover to work after changing link color with jquery?
hi, i changed the color of a link by using jquery. before the link was like this: <a id="1" href="#">My Link</a> after using jquery like this: $("#mainnavi li a:eq(0)").click( function() { $(".subnavi_container").hide("fast"); $(".subnavi_container:eq(0)").show("slow"); $("#mainnavi li a").css("color", "#aaa9ab"); $("#mainnavi li a:eq(0)").css("color", "#373438"); } ); the link looks like this: <a id="1" href="#" style="color:
Conditional .wrap
Wrap is being used to apply css to a div around certain h3 elements with defined classes. This works flawlessly. However we'd like to have a default h3, where no class is specified have a div class wrap it. I am able to accomplish this when there is only one other class option, however our client now wants a multitude of other div h3 class options. Is there some way to accomplish this. Here is the code for just 1 other option: jq(".wiki-content h3[class!=red]").wrap("<div class=\"wikicontenth3\"></div>");
adding fadeIn when loading content not working.
Can´t get this to work after all day trying. I wen´t through the documentation but still no luck. I am trying to load with a fadeIn different html pages into one same div when a menu element is clicked. So far I found this way of doing it here at the forums. It is for the loading part but I can´t figure out a way to add the fadeIn within the same piece of javascript code. Any help would be appreciated. Thank you <ul> <li><a href="#" onclick="javascript:$('#content').load('page1.html');">page1</a></li>
Auto resize all div height to fit text the the largest text.
Hi, I currently have multiple combos of image with a description text below it. I want to lay them out in rows and inline. So if the width of page is not enough the next one should start beginning of next row. Each image and text is currently house by a div with float left and a set width, but if you look at the attached screenshot (1.jpg), The Oracle - eBusiness Suite gets stuck because of the differents height due to text size and if I set a height too, then some of the text gets covered up (2.jpg).
PHP include - jQuery execution does not work
Hi, I've noticed after some code investigation that I cannot execute jQuery within 'included' php sites. The structure looks like the following: index.php: ----------- <html> <head> <script here I load all jQuery stuff /> </head> <body> <div> This is on the index.php and jquery works </div> <div> <?php include("siteToBeIncluded.php"); ?> </div> </body> </html> siteToBeIncluded.php: ------------------------- <p>This is
simple scrolling script
Hi everyone Im new to this forum, so thanks in advance to anyone who can point me in the right direction! I have a script which I modified to suit my needs, which works, except it's showing some weird results. Allow me to explain... $(function(){ $('a').click(function(){ var targetID = $(this).attr('href'); var targetPos = $(targetID).offset().top $('html, body').animate({scrollTop: targetPos-15}, 800); return false; }); });The script is smooth scrolling me
Change event producing unexpected results
I am trying to set a function to be called on the change event of some textboxes with the classes "vii_year1", "vii_year2", "vii_year3", and "vii_year4". Here is the code: $(document).ready(function() { for (var i = 1; i <= 4; i++) { var year = i + ''; $(".vii_year" + i).change(function(){ SetValidators(year); }) } }) The function I want to run is SetValidators, passing the year, 1 to 4. When the code executes, the year value passed is always 4, no matter what the class of the control. Can
How to control large number of ajax requests?
I have a element when click, it will trigger some other elements to be selected. and those elements will trigger elements in next level. It is a three levels hierarchy so to speak. but each element will send an ajax request when selected. Those requests will become out of control especially when I repeatedly click the root element. Can I queue those XHR request in a queue and send them one by one? or maybe add a delay before send so that they can collect their information into one batch request and
Triggering Element Logic
I have bound functions to certain element events, which contain logic which decides whether or not other elements are hidden/visible. Such as the code below: $("#menu_include").change(function() { if ($(this).attr('checked')==true) { $("#menu_order").parent().show(); } else { $("#menu_order").parent().hide(); }Pretty straight forward. I tick the menu_include checkbox and something else is hidden. What I'd like to know is: is it possible to trigger this logic upon the
error function not triggered when using $.ajax() to load an external script
Hi, I'm using $.ajax() to load an external script, to get the latest updates from a twitter user. I'm using this so that Twitter downtime doesn't affect my site, because if I hardcode this in the HTML, my document.ready function halts or errors if/while twitter is down. The problem is I can't get the error function to trigger when the loading fails. This is what I'm using: $.ajax({ url: twitter_url , timeout: 20000, dataType: 'script', success: twitter_LoadSuccess, error: twitter_LoadError,
Simple changing background image slideshow
I'm just starting to use jquery in my websites, but I'm stuck on this. The page I'm making - www.chirho.co.uk/maggie - has a header div which is just the logo with a background image. I put a bit of php into the css so that every time the page is loaded, a random background gets loaded from a set of 7: background: #000 url(../img/back0<?php echo rand(1,7); ?>.jpg) no-repeat; I'd like to go a step further and - using jquery - have the background image change every few seconds. Nothing fancy. Just
Selecting the last two digits.
Like, I want to select the last two digits (like €50,25) to make it a bit smaller. I would put it inside a Paragraphs. Is there a selector for this?
fadeIn divs one after the other
Hi all, I have 5 divs on a page all with the class of "cases". I want all these divs to fadein one second after the previous one loaded. To accomplish this I tried the following; $('div.cases').each(function() { $(this).hide().delay(1000).fadeIn(1850); }So I want; first div fades in on .ready() - one second wait - the second one fades in - one second wait - the third one fades in etc. etc. etc. Currently all the divs load at the same time. Can someone help me with this? Thanks!
How to find parent's tag name
I want to check if the image wrapped by a tag, so I write the code like $('img').each(function() { console.log($(this).parent().tagName); }); but it seems not work, how to do it?
next element in document order?
Is there a way to get the next element in document order? For example I want to get the next "<a>" element, whether it's a sibling, descendant of a sibling, or ancestor's sibling
Understanding jquery Chaining
My question concerns the chaining of commands / events in jQuery. In short, I'm trying to grab the 'title' attribute from an image, and display that as the caption for the image. I'm doing this by using jquery's .attr('title') and .appendTo() events. The following code is what is accomplishing this functionality: $(document).ready(function(){ var title title = $('img.myClass').attr('title'); $('div.append-here').append(title); }); BUT ... for the sake of learning and "Write Less ... Do More" -
jQuery(window).load(...) registered "after" window load event?
Hello, I am new to the group and just had a simple question about the jQuery(window).load(function() {});. I have an external JS file that gets inserted dynamically on the page after the window load event occurs. Inside this JS file I have a statement as follows: jQuery(window).load(function() { alert("Something"); }); The question I have is, would the alert() statement above get executed because by the time my above function gets registered to the window load event, the event has already fired.
Looping function and :hover interaction
I have a function that calls itself at the end with a setTimeout . This means that the hover event for that element fires as many times as the function has run (eg looped 3 times - 3 hover events fire). Is there a more efficient manner of looping that I should be using?
World population counter or clock in jQuery?
Hi All, I'm looking to add a counter which will start a base (numberic) value then increase at a set rate (i.e. 1 every 3 seconds). Quite similar to the idea of a world population clock or counter. I've know there are ways of doing it in JS but wondered if anyone as done it in jQuery and hence cutting now the amount of code. Here's a sample in regular JS: http://javascript.internet.com/math-related/world-population.html Thanks! R x
jQuery on PHP WHILE loop
I have <a> tags generated from a mysql query in a php while loop. I also have jQuery selecting those anchor tags to run a behind-the-scenes Add To MyList function for the list of products being displayed. My problem is only the first anchor tag a triggering the jQuery. My thought is it has something to do with not having a unique "id" for each <a> tag??? I successfully created a unique id for each <a>, but still the same problem. I know showing the code is the ideal way to solve most problems,
How to use jQuery in object context ?
Hi all ! I have a problem using jQuery in an object context. "This" keywords to refer to myObject is not usable in a jQuery function... var myObject = function (){ this.myProperty = "value"; $('#divId').click(function(){ $(this).html(this.myProperty); }); } How to solve this problem ? Thanks
jQuery/Axaj and PHP NUSOAP WSDL service
Hello, I'm trying to use jQuery Ajax with WSDL service and can't understand, what's wrong ;-( I want to choose game name and then use ajax to load race names for that game to select from list. I want to use NUSOAP WSDL service for that: http://test.galaxy.lt/xml.php Service is up and running, soapUI software tests it and I get results from DB, that's ok. Now I want to use jQuery to use this WSDL. My test html with jquery is at: http://test.galaxy.lt/test.html After selecting game jQuery
Feature Detection -- knowing what feature to detect for dealing w/ border-radius issue using $.support
Hi everyone... hope y'all are having a fun n' festive jQuery-filled day! Here's my dilemma. Hopefully, someone can help me out. The situation: I'm building a site for my boss that uses rounded corners on divs. For modern browsers, I'm using the .corners() plug-in, but it isn't a perfect solution. In particular, the css Border properties aren't displaying the same in IE (and, until I upgraded Opera today, the prior version of Opera showed the same thing). Specifically, when keeping the border
Rotating Tabbed Information Box
Hello, Looking to create an animated rotating tabbed informational box using jQuery, and can't find a plugin or example to do it. Can anyone suggest where to look? I want it to function like this, only using jQuery: http://www.webergrillrestaurant.com/homenews.html The page should automatically rotate through the different tabs of information (with on and off states for the tabs) Upon hover of the tab, the autorotation stops and that tab is activated (information is shown for that tab) Thanks!
obtaining siblings between two selectors?
i've been trying to figure the best method to achieve obtaining siblings between specific selectors. Let me be concrete with an example: ... <tr class="rowTypeA"> ... </tr> <tr class="rowTypeB"> <td>value 1</td> ... <td>value 2</td> </tr> <tr class="rowTypeB"> <td>value 3</td> ... <td>value 4</td> </tr> <tr class="rowTypeB"> <td>value</td> ... <td>value 2</td> </tr> <tr class="rowTypeA"> ... </tr> If I have a selector to find the table cell (td) with value equal to "value 3",
Image slideout help
I have two images. Both are 160x600 pixels. One image is displayed by default. On mouseover of that image, the other image needs to slide out from the left. I have it working on a blank page, but whenever I place it with other HTML, the second image will slide out, but will slide back in immediately. If I mouseover the first image a few times, the second image will eventually stay popped-out, but only after hovering mouse cursor over the first image a few times. Here's my code: <script type="text/javascript">
Flicker free initialization that degrades gracefully
One big issue I've found with various jQuery UI widgets and other effects if that they cause a "browser flash" on initialization, a prime example being how for tabs all the content is visible until the tab initializes and then all the non-active tabs vanish. One way around this is to add the jQuery UI classes manually in your markup so that the tabset appears the same regardless of whether or not the tabs have been initialized, but this does not degrade gracefully and leaves users without javascript
Correct fadeIn -Our syntax
I'm having a problem with a routine that I want to fade in a text value, wait and then fade out. I've tried doing this with two different syntax options and while the text shows up, it does not fade out. Can someone tell me what I'm doing wrong? case one - $("div#Msg").html(rtnValue).fadeIn("slow").wait(5000).fadeOut("slow"); case two - $("div#Msg").fadeIn("slow", function() { $("div#Msg").html(rtnValue).wait(5000).fadeOut("slow");
Offset behavior in I.E.
Hi ! I posted this in the comments of the offset page but of course it wasn't the good place :S Sorry for that, here is the post : Don't know if it's a bug or if I'm just being noob but I found a strange behavior when offset() is used with only one coordinate : $('element').offset({left : left_coord}); works perfectly in Firefox, Opera, and Safari but throws a javascript error in IE 6, 7 or 8 ("invalid argument"). IE needs both coordinates to be specified, like this : $('element').offset({top : top_coord
Works Perfectly With Google's Chrome and 80% of the Time with Firefox.
I have had a working jquery application for many months where an input entry box in HTML has a change selector function. Recently, I added an autocomplete function against the same input box id. The autocomplete function always works perfectly. After 4 characters, an ajax request heads to the database, and retrieves matches. When a user selects a suggested match, the input box triggers due to a change in value. This calls the second jQuery function which fetches detailed information from the database
Problems with .load() function : nothing working
Hi, I have some problems with the .load() function. On my local machine, everything is working fine. But, when I upload my document on my web server, the .load() function does not work anymore (with Safari, IE, Fx, ...) Is anybody knows why ? The code is here : http://processx.net/easymodules/test.html (It's the standard test code from jquery.com) Thanks in advance !
event and .trigger()
Hi Folks, I'm jiggling around with some curiosity (which maybe isn't really one). In a click event handler for a CHECKBOX I have this code (example): if($(this).attr('checked')) {do something}if you click on that checkbox (by yourself, with your own hand and your own mouse), the handler is fired and its attribute checked is = checked. ===-- setting back the checkbox state to unchecked (pagereload) --=== Now, if you call $("#that-checkbox").trigger("click") from somewhere else, $(this).attr('checked')
.append not working like I think it should, help
here's what I'm trying to do... I have xml that returns names (firstname, lastname, email address) I want to put the email address in an <a link and wrap it around the name. here's what I'm doing, which seems it would be correct: $(theXml).find("name").each(function(){ $clickLink = "<a onClick='parent.EMAIL_FIELD.value='" + '"' + $(this).find("email").text() + '"' + "'>"; $("#addrBook").append($clickLink + $(this).find("firstName").text() + " " + $(this).find("lastName").text() + "<br/>"
Opera issue
function pridajDoKosika(kod){ $.get("/ajax/dokosika/"+kod,function(data){ var obj = $.parseJSON(data); obnovKosik(obj.suma+",-",obj.pocet); } ); }This is object XMLHttpRequest in opera console: abort prototype Object readyState 4 responseText "{"suma":1249,"pocet":1}" responseXML XMLDocument baseURI null characterSet "utf-8" charset "utf-8" dir "" documentElement null firstChild null lastChild null status 200 statusText "OK"I don't know why Opera expect XML data and don't parse returned
Ajax success callback not firing if argument is null or not assign?
I used to call web service with parameter like this and works fine. function InvokeRequest(Url, Param, SuccessCallback, ErrorCallback) { $.ajax({ type: "POST", url: Url, cache: false, contentType: "application/json; charset=utf-8", data: Param, dataType: "json", success: SuccessCallback, error: ErrorCallback }); } Today I have a web service which do not need any parameter, so I invoke with Param = "" and I have tried = null too.
Change src works randomly
Newbie here, using this at new job. Working with previous code. I also tried to change the innerHTML of the outer div (outer to the bookButton), which worked, but it stopped the form being submitted, All we need to do is change an image then submit a form., this is the code that does the change:$(document).ready(function(){ $('#bookButton').click(function() { if($("#checkoutForm").valid() == true) { //$("#bookButton").attr("src","images/booking/process-btn.png");
Slide up / Slide down when clicking same object - Help!
Hi! I am very new to using jquery (and any javascript at all really) and I am having a dillema. I am trying to have several expandable sections of my webpage but I only want one to be opened at a time so I want to use slideUp and slideDown rather than slideToggle. I want to use the same button to open and close the section. How do I do this? Here is my current jquery code, as of right now when I click expandButton1 the itemContent1 section closes and then reopens immediately: <script> $("#expandButton1").click(function
Object "traversal"
It's not really traversal, more like node selector I guess. It might not have anything to do with JQuery but if I can use it to achieve what I want it doesn't matter. I have an object that I create from JSON that looks like: { "totalUniversities" : "2", "universities" : { "MIT" : { "key" : "", "totalPlaces" : "12", "totalPlacesSpring" : "6", "totalPlacesAutumn" : "6", "totalSubjects" : "2", "subjects" : [
Jquery async treeview problem. IE hangs!
Language used: ASP On the main page i have one button. On clicking this button a popup window opens up, displaying an asynchronous tree i.e. lazy loading (loading and displaying the 'immediate' children of the clicked node, instead of loading all the children, sub-children, sub-sub-children all at once). Using 'jquery' the tree is displayed. All the nodes of the tree are in the form of links, on clicking on any link, the popup window closes and the selected string is displayed in the textbox on the
jquery ajax event model and that of Microsoft Ajax Control Tool Kit
jquery provides ajaxStart() and ajaxStop() events. Those two events do not seem to be triggered if the ajax requests are made by Microsoft Ajax tool Kit (from ASP.Net code). Is there any way to bridge those two event models? If not currently possible, is there any future initiative or plan out there to make this happen?
Next Page