OR operator in jQuery
Hi guys, Can anyone assist me what is the correct way to use OR operator? If tried this code but it does not work; Anyone can help me out please? $('[name=tel_home]' || '[name=tel_mob]').parent().removeClass('error'); if($('[name=tel_home]' || '[name=tel_mob]').val()==""){ error_num++; error_mesg += "Please input one of Telephone numbers.\n"; $('[name=tel_home]' || '[name=tel_mob]').parent().addClass('error'); }
overlap of drop down menu and accordion block (display problem)
(note : i renamed this topic, original post was sent yesterday under "override of drop down menu and accordion (display problem)" and published in Using Jquery UI) Hi all I set a drop down menu using jquery naviDropDown 1.0 and use accordion of jquery-ui-1.8.11 too. I have a problem because the drop down menu is diplayed behing the accordion block. Does anyone know what the problem could be ? I attach a screenshot of what happens and head and mennu and accordion code. Head statements : Copy code
Show() N elements
Hello, I have a PHP loop, creating a <div>, ten times, and a <select> with option from 1 to 10. What i'd like to do : when I select the <option value="N"> in my <select>, i'd like the N first <div> to appear, and hide the others. How I can do this in a clean jquery way ?
Vertical tab and Horizontal tab navigation
Hi, I need for a design with vertical and horizontal box type of TAB navigation using Jquery. Please go see below sample image as i provided. Please anyone help me to get the design as below. Thanks in Advance. Gnanavel
jQuery sliding with .animation
I was hoping you guys could help me out with a problem. I am quite new to jQuery so talking to me like a beginner would help. I understand how to use jQuery to slide elements up and down but I want to know how to slide them from left to right and vise versa. My scenario is this. I have 3 images in a line. When the user clicks on the image far left I am hoping it slides out a div containing text from left to right while this is going on the other two images need to also move to the right along with
show input box based on select value
I have the following code doing ALMOST what I want. It shows an input field when the select value is "dropped". The problem I am having is that if I select "dropped" it will display the input field, but if i select a different value AFTER selecting "dropped" the input field is sill displaying. How would I get it to hide the input field if it is NOT selected? Thanks for any help! <!--SHOW/HIDE DIV--> <script type="text/javascript"> $(document).ready(function(){ $('#dropped').hide(); $("#thechoices").change(function(){
.clone() problem
I have a simple form that has row of input fields where the user can add values, and under one of the input boxes on the next row I have a total. This type of thing (a simplified version) <table> <tr class="dataRow"> <td>[Input box]</td> <td>[Add new row button]</td> </tr> <tr> <td><span id="Total"></span></td> <td></td> </tr> At the end of each row with the class of 'dataRow' I have a button to add a new row. Clicking this button adds a new row of that type. So no probelm there. The issue is that
problem with php pagination and jquery/js (image rotator)
I'm having a slight problem with php pagination and jquery/js. On the following page http://dev2.bluemuledesign.com/athletes.php you'll see an "athlete profile" area. Whenever an athlete photo is selected, javascript/php are used to switch out the athlete info. This works perfectly fine. The problem occurs if I use the left or right arrows to view more athletes (the left and right arrows are set with php pagination to switch to the next four records in the database). Whenever I do this, the athlete
Naming variables
This is not a question, but a point worth emphasising. When naming variables I often see people using names such as 'url', 'width' and function names such as 'hide()', etc. I would encourage people to avoid this practice! Although they are not necessarily reserved words or invalid names, they can cause very hard to find errors. In particular, they may work well in one browser, but cause strange effects in another browser. In particular, if you name a function, for example, 'hide()' it is possible
Head tag of ajax content ignored in Safari but nowhere else
I just noticed that some javascript I put in the <head> section of a page that's later loaded via ajax isn't being run in safari. For example here's a page: <html> <head> <script type="text/javascript">alert("hi");</script> </head> <body></body></html> If I load that page up via ajax: $(body).load("page.htm") safari never fires the alert, but all other browsers do Is this by design, maybe head sections are supposed to be ignored in ajax content? It's not a big deal, I can easily put the script into
Jquery Color change
Hey, I am currently trying to change the color of my text in jquery. The problem im having is im not sure how to change my color back to the original css color when I click on the other link. Instead the color just remains and does not go away. (By the way im not strong on this language so keep it simple for me) Cheers. Here is my code: $('#navigation ul.submenu li a.sug').click(function() { $('#navigation ul.submenu li a.sug').css("color","#e1519f"); }); $('#navigation ul.submenu li a.man').click(function()
Sorting and Hiding list elements
Let's say I have two lists for menus and one list for sortable content. <ul id="type"> <li>A</li> <li>B</li> <li>C</li> <li>D</li> </ul> <ul id="location"> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> <ul id="content"> <li class="A 1"></li> <li class="A 2"></li> <li class="B 2"></li> <li class="D 4"></li> </ul> If I click on "A" in the #type list, the content list is sorted, the li's with the classes "B" and "D" are hidden
jquery html fragment results in different no of elements in internet explorer
Hi, I tried this code in http://jsfiddle.net/sesrikanth/AyPwh/ jquery reports as 4 elements in firefox/chrome browsers correctly where as 0 in internet explorer 6.0 How do i fix this? Should I report this as bug?
Display text from selected html tags
suppose i have a strings (html): Lorem ipsum dolor sit amet, <span id="display_only">consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. </span>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. How can i display only the text whicj is inside the #display_only tag.... So that the result would be consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt
not $(this).....
$('#radioBtn1,#radioBtn2,#radioBtn3').click(function(e) { e.preventDefault(); $(this).parent().parent().children().addClass('bgImg'); $(this).parent().parent().children().removeClass('bgImg'); // how do I remove class from two buttons NOT clicked????? thank you..
Form Validation Question
Hello All, I'm a bit stumped on what the best way to validate my form that I have built out. Here is the form. http://pretendcity.org/temp/asq/index.html This is what I need it to have do: 1. If the user select "My Child is older than 5 1/2" the form should decline. 2. ZIP code has to be one of the ones I have from a list I was given (about 50 ZIP codes) I cannot figure out how to do both, I was told to do the ZIP by passing it through with an array but I'm not too familiar with jQuery or java (im
Problem with IE8 and slideUp
Hi and i hope youll be able to help me. Im writing a little script thats supposed to show a sublist when a link is clicked and hide all other sublists at the same time. And it works fine except of course in IE8... When i click the link there it just expands a bit and then hides again. I tried everything i could think of.. i tried commenting out everything except for the line thats supposed to show it and changing the method to show(). That shows it, but when using slideToggle() or toggle() there
Firebug and hidden input fields
Hi, I have 5 hidden input fields in a form that I'm processing in jquery with $('#some-id').val(); which works fine in Firefox with Firebug not installed (and also other browsers). However if I have Firebug installed it deletes some of the values of the hidden input fields and some get mixed up, seemingly at random. It works fine if I change the input fields to text fields, but obviously I don't want that. Anyone else come across this problem? Is there a way around this? Most users won't have firebug
Multiple Selectors
I am having trouble with using multiple selectors for my table striping. I am currently using the following. $("table:not(.no-stripe) tr:odd").addClass("tablestripe"); This works great except that occasionally there will be a row in the table that has a class assigned to it that ends with "tablehead" to give a different background and font color to the row. I don't want those rows to be affected by the striping. <tr class="dkredtablehead"> I am also using $("table:not(.no-stripe) tr:not([class*='tablehead'])").hover(
player in iframe
Hi everyone, I have a default.asp page and within an iframe that displays another page with a video. (there are used SWFObject and jwplayer). how do I take the player object (within iframe) from default page? so, that I could trigger a play/stop function? thanks a lot bye
Help to modify a jquery script
Hi! I need help from you, sorry for my english, I hope you understand me... I have a gallery made with jquery, based on this example: http://demo.webdeveloperplus.com/featured-content-slider/ So, I'd like to have the transition effect not only in the main image, but on the right - grey panel too. The script I actually use is very simple: $(document).ready(function(){ $("#featured").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true); }); Can you help me to modify it as I need? Thank you very
how to get multiple form input, select values from the same page in php?
I have multiple <select></select> elements in a php page. After an option is chosen from the first drop down <select></select> element, options of the 2nd drop down <select></select> element will show up. Selection of an option from the 2nd drop down list will get the options in the 3rd dropdown list show up. Thus input from the 3rd drop down list will show up the options in the 4th drop down list. Such is the case for the 4th, 5th ,... drop down list. each time depending on the inputs from the
Adding code to parent from within iframe?
I'm not sure if this is something that it makes sense to use jQuery for or whether I can just use a bit of javascript to achieve the same thing, or whether it can be done at all. I've spent quite some time trying to understand the issue but have very little javascript or jQuery knowledge so hoping someone can help me out. What I want to be able to from within an iframe is: check if parent.window.document.getElementById("autoloadpop") is null and if so I want to add: <a href='popup.php' id='autoloadpop'
Maphilight or similar plugin, recursive mouseover()
Hi, I'm looking for a plugin, where I can highlight area-ojects on mouseover() . I tried using maphilight for this but I'm getting a problem with the following idea : When user gets over field_a, field_a and field_b should be highlighted. When user gets over field_b, field_a and field_b should be highlighted. I thought of something similar to this jQuery('#field_a').mouseover(function(e) { jQuery('#field_b').mouseover(); }).mouseout(function(e) { jQuery('#field_b').mouseout();
stop() does not clear delay()
When calling the following line repeatedly on some element, the delay() in the queue is never stopped from running. $('#element').stop(true,true).show().delay(2000).fadeOut(1000);
How do I prevent page from scrolling in IE
Hi, I am making a game using the gameQuery library. The game is contained in an iframe and everything works fine in any other browser than IE. The iframe has it's own js that handles the whole game logic. I need the controls to be with the arrows. Here is all I've tried to prevent it from scrolling. This js is included in the containing page : $(document).keypress(function(e) { console.log("keypress_SCROLLS"); e.stopPropagation(); e.preventDefault(); return false; }); $(document).keydown(function(e)
jQuery not recognizing <embed> element in IE
Hi Guys, The following line give me two different result in IE and Firfox. Does anyone have any idea? alert ( $('#top-ad object').children().length ); //IE return 3 //Firefox return 4 so it looks like jQuery not recognizing <embed> element in IE. So how can I select that embed thing. Thanks <div id="top-ad"> <object....> <param....> <param....> <param....> <embed...> </object
Event Handler triggered for certain time + smooth animation
I'm trying to get smooth scrolling done on a huge horizontal slide. I've got Event Handler for mousewheel working but the animation is choppy as h&%l. You can see the test here. Test is inspired by these guys. The way it works now: delta (mousewheel scroll) is positive or negative. Now it adds or subtract a value on variable for maximum negative margin. Scrolling of DIV is done by immediately change of value for leftMargin. What I want ; something like delta change smooth out with .animate() over
send href variable to new page img src - advice appreciated!
Sorry to bother with such a basic request but have been searching for an answer to this for 2days now & cannot find a precise answer.. I have a base html page which contains several thumbnail images with links to enlarged images which I'd like to view in an external page [so I can control the dimensions of the enlarged image]. I thought it best to use an external template html page to launch these within and therefore imagine I need to declare the variable in the thumb links page & image they may
Fire an event when the page is fully loaded
Hi @ all.. I want to fire an event when the page is fully loaded. I used the ready function but the event will be fired to early. Ok, the DOM is fully loaded but some pictures are still not there/resized. The reason is that i want to get the height of the content. If i use the ready function it may be that the height is incorrect, because some elements (for example: pictures) are not fully loaded/resized. I need a function which gets the height of the content when everything is absolutely loaded.
Jquery get method can sometimes generate postbacks?
Hi, I have a strange problem: I'm using jquery get method to do some stuff server side and than display some results in a div. Sometimes the code acts weird: the calling page gets postback, but this seems to be random....I'm accessing the Session in the page that is called with get...could this be the problem? Thanks in advanced.
Browser compatibility
_______________________________________ http://www.clean-energyconsultants.com _______________________________________ This is the basic website I'm creating at the moment, and as you will see if you open the link, I implement jquery ui to the extent of an accordion menu with nested buttons for each link. My issues: Chrome: none (except the animated gif in the home page?) FF: the accordion menu appears to work, but each button links the new pages to new tabs, rather than in the "_body" frame.
How to use click and after
Hi, I have the following code fragment that does not work, can anybody help please. This fragment is accessed from another HTML page that includes all the necessary JQuery libraries. <link rel="stylesheet" type="text/css" href="/fedora-ui/menu/search.css" media="screen" /> <link rel="stylesheet" type="text/css" media="screen" href="/fedora-ui/menu/ui.jqgrid.css" /> <script src="/jquery/jqGrid/js/ui.multiselect.js" type="text/javascript"></script> <script type="text/javascript"> $(function()
PrevAll order documentation
Here http://api.jquery.com/prevAll/#comment-33411999 guest asks about element order in prevAll function. So my questions are: does inverse order guaranteed why this feature isnt documented example: .class1 #id1 .class2 #id21 .class3 #id31 .class2 #id22 .class3 #id32 .class3 #id33 .class1 #id4 i'm have a node #id32 and i need first preceeding .class2 so i'm do $("#id33").prevAll(".class2").first() could i rely on inverse order or once it could be broken
Using the same plugin twice
Hey, I have a page where im using the Star Rating Widget. I need it to change more than one set of radio buttons into stars, but under the same div. jQuery(document).ready(function(){ jQuery("#stars-disabled").stars({ disabled: true}); }); #stars-disabled being the div, which is used more than once as i have a random amount of users commenting on and rating the same product. So far it only converts the first set it comes across, then the rest are left as normal. Anybody know how i can get
jQuery Ajax call not forwarding to success action
Hello, I am new to jQuery and Ajax. The problem that I am having, is that I am trying to make an ajax call to a struts action that makes a change to the database and upon "SUCCESS", have the control forwarded to another action that will redirect the user to another jsp and construct a page for the user. Everything seems to be working fine except the redirect part. The user is not redirected and only the HTML shows in the response. Any help is welcome and appreciated. I understand that my issue may
Slideshow script ported script from Prototype... need assistance
I found this neat simple slideshow... it's just 1 JS file, and it barely scrolls. Really lightweight.. but I found it used Prototype, so I ported it to jQuery perfectly, and it works great, but now I want to extend it, to have those little bubble indicators, where it shows which slide you're currently on, and when you click on one, it goes to that slide. I've got it all working fine, except the ability to move to a different slide when you click a bubble... I'm not sure what the ""goto_slide" function
XML + CSS + event_handlers is it possible?
I've used jQuery to attach event handlers like mouseover to HTML elements such as span and div. I am now thinking of using XML and CSS for presentation instead of HTML but I can't see a way to attach event handlers. Is it possible at all. Is it possible using jQuery?
Application Remote
Good Day, I would like to build an application which could be 'remotely controlled', so to speak, using jQuery. Example, let's say I have a system setup to where a user on my website is reading a blog posting, and from my own computer, I change a setting on my site. How can I, using jquery, make my app 'listen' for those changes and act accordingly? Right now I have a script checking every 5 seconds, setTimeout("function();", 5000);, to complete the task. Is this the right way to do it, or is there
problem with .width()
Hi, i have make a simple code http://jsfiddle.net/pZdrg/ if you click on the first text it was ok, but if you click on the second text, you can see a space on the right side, but i dont know why :/ (and on IE 8 the Width / Height will give wrong value)
Next Page