draggable image display problem
Hi all I have a developed a site at http://www.ozones.co.uk/originationnew/ The aim is to have lots of draggable blocks which highlight on mouse over and when clicked pop up a window. This works fine in all browsers bar IE. If you drag an element say who we are to a new location and then move the mouse out and try completing a roll over on it then the highlight image appears but the first image doesnt. Please can anyone suggest why this could be? Thanks Nick
Can Jquery Navigate to a HTML Page Marker from a URL?
Hey: I am wondering if Jquery can navigate to a specific page marker from the url? For example: http://www.website.com/index.html#5 Can i test the url to see if it has the #... added and then use that number to navigate to an appropriate page marker? Thanks!
selecting elements by value
Hi All, I'm new to jquery so pardon my ignorance but is there an easy way to select a hidden field by it's value? I have a table with multiple rows: <row> hidden field (serial number) + checkbox + label <row> hidden field (serial number) + checkbox + label <row> hidden field (serial number) + checkbox + label <row> hidden field (serial number) + checkbox + label <row> hidden field (serial number) + checkbox + label I've got a function which takes in a serial number and I want to find the label corresponding
Image Scroller
Hi, I'm fairly new to jQuery. I've written a code for image scroller, a display of 2 images at one time with left and right arrows. It works completely fine. However, now the requirement is to display 4 images at one time instead of 2. I have increased the width of the image and done some related changes; however the scrolling doesn't change. it still shows 2 images at a time. Pls suggest. Here is the code snippet: Global.js //Work Scroller // var numThumbs = $("#work-scroll img").length; var
iFrames, sliders, and resizing.
Hi, I have an iframe that when a page is loaded into it: function dslide(){$("#mainframe").slideUp(1000);} The is called in links' onClick event. I have an auto-frame resizing system that was working before this, but after it, when a new page was loaded, it would set a height of 35, or only the first line on the page. However, if the page was previously loaded and the link is clicked again, the page loads fine. Help! function doIframe(){ } pausecomp(50); o = document.getElementsByTagName('iframe');
Oscommerce header page and center menu
I apologize for the newbie question and I've seen this has been asked quite a bit but I can't seem to find any solution for centering my menus in the header file of my oscommerce shop can any one Please help me or direct me where I can find really simple instructions, Thank you in advance Kelly
query about :first-child
HI, I am new to Jquery. Im trying to remove first child inside div. Below example i am trying <!DOCTYPE html> <html><head> <style> span { color:#008; } span.sogreen { color:green; font-weight: bolder; } </style> <script src="http://code.jquery.com/jquery-latest.min.js"></script> </head><body> <div id= id1> <span>John,</span> <span>Karl,</span> <span>Brandon</span> </div> <div> <span>Glen,</span> <span>Tane,</span> <span>Ralph</span>
jquery filter to match php
none of the validation plugins and jquery tools validation seem to fit my needs, so i decided to follow a tutorial and write mine from scratch. i followed the tutorial for the jquery side from here: http://yensdesign.com/2009/01/how-validate-forms-both-sides-using-php-jquery/ i've incorporated a php email script i had for a while instead and copied the email validation from my jquery script into php so they match. jquery and php validation both works and email sends [php] if(trim($_POST['email'])
What if I don't set timeout when using ajax? Is there a default set?
What if I don't set timeout when using ajax? Is there a default set? What's the longest timeout set? Is there a endless ajax request? $.ajax({ type:"post", url:"", data:{}, success:function(html){ } }); this request will last longer than 30 minutes and I found when the task is over ,it didn't execute the success function? Will it auto shut down when the request lasting too long ?
Jquery object's context always is undefined
Hi Guys, I try to use jQuery( html, [ ownerDocument ] ) to create a element and get the jquery object. var $list = $('<ul class="list">'); console.log($list.context); // return undefined $('body').append($list); console.log($list.context); // return undefined But the jquery object's context is undefined. Even if I append it onto another element. So can anyone tell me how can I set the context to the jquery object? (Right now I just set the context as document manually... But I think it's not a good
String from Java Servlet to HTML via jQuery
Hey, I have some problems with jQuery: I want to generate dynamic html code via java serlvets. from the class LightServlet public void getAllLights(HttpServletRequest request, HttpServletResponse response) throws IOException, NumberFormatException, InvalidSyntaxException { response.setContentType("text/xml"); PrintWriter out = response.getWriter(); out.println("<div><report>"); for (int x = 0; x < l.getLightAmount(); x++) {
Simple Text Animation
I have a simple script that displays some random text from an external .js array. <script language="JavaScript"> <!-- document.write(r_text[i]); //--> </script> This array has a simple random function at the end: var i = Math.floor(25*Math.random()) I want to display these strings without having to refresh, vertically scrolling from one to the next. Can anyone tell me how to accomplish this using jQuery?
getting problem in sending ajax request with array of checkbox data
i am having this array of check box which is created by api and appended to the div myText { 'success':true, 'message':'get' ,'items':' <input type=\'checkbox\' value=\'21\' class=\'gibs\' name=\'gibs\' >Rahul2\'s Gib <br/> <input type=\'checkbox\' value=\'1\' class=\'gibs\' name=\'gibs\' >rahuls Gib <br/>' } $("#divTxt").append(response.items); now i want to value of this checkboxes to ajax request how can i send the values in data string . please help.. regards rahul
Is there a way to control the order in which functions are called, if using $(form).submit(function)?
If you call the following: $(form).submit(fun1); $(form).submit(fun2); $(form).submit(fun3); it seems as though, when the form gets submitted, fun1 will get called first, followed by fun2, followed by fun3. My problem is, I'd like to call fun3 before I call fun2. In practice, my situation is a little different. Here are the specifics. I'm using the labelify plugin, which uses the label for a form element as the value of the form element. On form submit, if the value of the input is equal to the label,
serializeArray to load form in a div.
So I am working on changing my website from iframes to divs, in which I will need to use javascript to make this happen as far as forms loading into a div rather than moving on in a iframe. But I'd rather use jquery personally . So I made my main.php more div like by applying the $('#frame').load('fight.php'); function which has worked wonders so far. Now I am working on a new file I call fight.php in which case users can fight monsters and increase their level. There is the better understanding
changing the dropdown option when textbox is clicked
I'm trying to do something like this: when you click the textbox, the dropdown will reset to the first option, but when you clicked on the dropdown, the text will become empty but my code won't work $('option').click(function(){ $(input[id=edit-title]).val(""); }); $(input[id=edit-title].click(function(){ $('option').val('option:first'); }); Any ideas what's wrong with this code? Thanks
Missing response with simultaneous requests - Please suggest.
I am writing an app, with lot of logic on client end (JS). Its a kind of polling application, polling multiple hosts simultaneously. (request same resource from multiple hosts. eg. http://host1/status, http://host2://status etc). Same callback (different scopes bound) handles the response. I am getting response back from only one host, all others are lost. Data shows up as "null" in all callback invocations except one. Firebug shows requests went thru (200 OK), received exact bytes of data (as many
got problem in giving click event of input button ..
hii , i am getting problem in giving click event of input button .. my code is for(var i=0;i<data.length;i++){ var acceptid="#Accept_"+data[i].cardid; var divcard='<div id="" style="border-bottom:1px solid white;">'+data[i].user_from+' '+data[i].card_type+ ' <input type="button" value="Accept" id='+"Accept_"+data[i].cardid+'> <input type="button" value="Delete"></div>';
Does inArray() not work for custom objects?
Does it call the object's equals method? I am trying to make sure only one date object for the same date is in an array. Thanks in advance!
wait for completed
Hi, how to run the second function only when the first will be completed in? $(document).ready(function() { $("#first").load("first.php?id="+ Math.random()); $("#second").load("second.php?id="+ Math.random()); });
get number of full calendar months between 2 dates
Hi, working further on my project lined out in a previous post - here's another pickle: I have two dates set, a beginning date and an end date for a period of time. That period can span several years. I now need to calculate the months in that period in accordance with the following reasoning: example: date1 = february 2, 2010 date2 = december 30, 2010 -> fullmonths = 9 (march, april, may, june, july, august, september, october, november) restBeginMonth = (28-2+1)/28 = 27/28 = 0,964 restEndMonth
.toggle disables links
I'm not sure wether this is how it's supposed to be or if one of the implementations is wrong, but here's the deal: Assuming #x and #y are links. $("#x").click(function() { $("#xi").show("fast"); });This results in #xi being displayed and the link being triggered, making you follow the link. $("#y").toggle(function() { $("#yi").show("fast"); }, function() { $("#yi").hide("fast"); });This results in #yi being displayed and the link not being triggered, you don't
superfish - dropdowns are showing under other elements on page
Probably not plugin specific and is probably better off in a css forum, but maybe someone here can help. I have a page I'm laying out and I'm using superfish for dropdown menus. But the dropdown menus are appearing under other elements on the page in Internet Explorer. in Chrome it shows just fine. I have attached screenshots to show what's going on.
Checkbox Variable
I am creating a jquery/ajax form and I'm having an issue with getting information from a checkbox. I believe my issue is with passing the variable. All the other fields in the form are working properly except for the checkboxes. Below is a snippet of the code where I am creating my variables (var name is an input/text field, var paperstock is a list/menu, and var finishing is the checkboxes in question: [code] var name = $('input[name=name]'); var paperstock = $('select[name=paperstock] option:selected');
Check to see if a value exist for a specific class & id pair
I need to require entry in specific circumstances. 1) a class (.securefield) must be absent on the field and the user must have edited the field. If class .secureifield is not on the field then if it contains data the user DID EDIT IT. So I think what I need is to select all fields that do not have the class securefield and then limit it to the target field id - #sigfield. would $('!.securefield').('#sigfield').val() select the field contents properly? Thanks.
String to array parsing
How can I split a piece of text like the following : /mysite/subSection into an array like the following : array( [0] => mysite [1] => subSection ); Please help ;-)
addClass -- much slower in ie7... workaround?
addClass seems much slower in ie7. any way around this? (chrome: 0.002 seconds, IE7: 0.312 seconds) It's not a big deal the first time, it's just annoying when you're doing it for different things. (example above was doing it on 254 elements) if anyone knows a workaround, let me know.
how to make a link functions like a submit button
Hello, I have a requirement that when a particular link is clicked, it submits back to the server. This is the same as clicking on a submit button. But the submit button is a link. Thanks,
"has" problem - speed...
".has('ul')" is much much much slower than ".filter(':has(ul)')". This seems counterintuitive. I've only tested this in IE7 and chrome, and the issue is much more pronounced in IE7. ====== ==IE7== ====== 3.313 seconds -- $li.has("ul"); 0.281 seconds -- $li.filter(":has(ul)"); ========== ==Chrome== ========== 0.152 seconds -- $li.has("ul"); 0.043 seconds -- $li.filter(":has(ul)"); Jquery version 1.4.2
SimpleCart Customization
/* PRODUCT DATA */ var bunny = [ 'name=baby lion', 'price=34.95','size=tiny','quantity=1','thumb=e.png' ]; /* ADD TO CART ON HOVER */ $('#allcards .singlecard').hover(function() { var card_id = $(this).attr("id"); simpleCart.add(card_id); }); Hello! I'm trying to implement a custom version of the simpleCart script and I'm having a small problem... When you hover over a div with a class of .singlecard, the script should find that div's unique id (in this case
Validate a string
Hi. I have quite a simple problem, which I cant find the solution for. var date = "12-02-2002"; var date2 = "55-66-2222"; var date3 = "1-02-k001"; How do I in the simplest way, validate these var´s, so that date and date2 validates, but date3 does not validate since its not in the right 'dd-mm-yyyy' format? (Would it be alot more difficult, if the validator also checks the date, and therefore date2 wouldnt validate?) Thanks alot :)
animate function
Need help! I have used jQuery to animate a div... The code is given below... jq("#light2").animate ({ width: 800, height: 500 }, 2000); The code above increases width & height of the div (#light2) with the animation duration of 2 seconds. The code works fine but I need to do something little different. The current animation's origin point is "top-left." The div expands to right & bottom simultaneously. Can someone tell me that how can I make this div to expand
Getting the index of an element with a given class
Hello folks, I have a bunch of elements with multiple classes like this: <div class="foo bar"> <div class="foo bar snafu"> <div class="foo bar"> I can get all these elements in an array like this: $ (".foo,.bar") My question is - is there an elegant way of getting the index (in this array) of the element that has the "snafu" class? Or should I just iterate through the array until I find the wanted element and then remember its index?
Problem with animating a layout (and laying it out...)
Hi guys, Having a bit of an issue trying to realise my design, got a current version here: Domus Dementia Alpha What I want is for the right hand box to animate in from the right and end up looking just like the left one, but first up when it appears it allows for scrolling to the right to bring it in frame, and it doesn't collapse in when the window gets smaller. I've tried using absolute positioning and "right:Xpx" but this makes it go over all the content on the page when the window gets smaller.
jQuey Bug selector with Chrome and FireFox
Hi :) ( first, sorry for my poor english... :) i'm french user and try to write my best...) Here's my HTML code : ... <script type="text/javascript" SRC="../_inc/jquery.js"></script> <script type="text/javascript" SRC="./_inc/jqtemplate.js"></script> ... <body> <div class="cdrGlobal"> <div class="cdrHeader">header</div> <div class="cdrMain"> <div class="Colonne">colonne 1</div> <div class="Colonne">colonne 2</div> <div class="Colonne">colonne 3</div> <div class="Colonne">colonne 4</div> main </div>
Keep layout after page refresh or submit
Hi, I have this very simple code and if I focus on the textfield or button the backgrond color changes to red. If I click submit, the page refreshes and the red background color is no more. How can I keep this background color after a page refresh or submit? The php in the head with the parse thing is just to load some jquery and css files your can replace it with '<script src="jquery-1.4.2.min.js" type="text/javascript"></script>' etc to test the code. This is the code: <!DOCTYPE html PUBLIC "-//W3C//DTD
converting 1 column table to two column
I'm using drupal, and am having trouble to convert a table to a one field two column at code level Is it possible to manipulate it using jquery using odd and even? Thanks
Nesting .has() selectors
I'm trying to find an element that contains a certain hierarchy of elements. I thought this could be accomplished by nesting the .has() selector. For example, assume the following hierarchy: <r> <a> <b1/> <b2/> <b3> <c/> </b3> </a> </r> for some reason: $('a:has(b1 + b2 + b3:has(c))') returns a $('r:has(a:has(b1 + b2 + b3))') returns r as expected, however: $('r:has(a:has(b1 + b2 + b3:has(c))') returns empty! What am
banner, slider.
Hello - I'm trying to do the following in plain english. When '#next' clicked, hide current 'li' element, and display the next. IF 'li:last' - rewind / 'show()' first li again. here is what i have so far.. please provide me with explanation to what's being done with your suggested approach. (also explain if possible, what was wrong on my end.) Thanks in advance! $('a#next').click(function() { var curlistItem = $('li:visible'); // find our 'visible' li element, and assign it to variable
Using jQuery Plugin (nivoSlider & accordian tested) with embedded video
Hello: I'm a relative newcomer to jQuery (and for that matter an inexperienced web builder) but I've really enjoyed using the jQuery UI and plugins as I work to redo my site. My problem is this. My site includes many video progressive download files. I have tried to combine either jQuery UI (Accordian) or a plugin (nivoSlider) (not both at the same time) with a video embed using SWFObject. For some reason the combination cause my video playback to stutter. Here are two test pages. They access they
Next Page