Set a cookie in jQuery
How can I set a cookie when a background color is changed? I created a basic switcher which changes the body color, but I want to save the changed color in a cookie. jQuery code: $('.first li ').click(function (e) { e.preventDefault(); $(this).parent().parent().find('img').removeClass('active'); $(this).addClass('active'); }); $('.first li').click(function (e) { e.preventDefault(); $(this).parent().parent().find('img').removeClass('active');
[Solved] 'unique' data value (how to ?)
Hi, I have this little problem which I can't seem to solve. So I have an object with a 'X' data stored. I want to store a copy of this data inside the same object. var object = $( '#mydiv' ); object.data( 'X', 'something' ); var copy = object.data('X'); object.data( 'Y', copy); The probleme is that X and Y seem to be linked, but I would like Y to remain the same regardless of what happens to X. So I found this complicated way to force the creation of a new object (the variable 'X' is a table) : var
Muliple JQuery UI Modals Not working
Hi, I have a page with two links that open two different modals, the "forgotten password" link opens the "forgotten password" modal and the "tell-a-friend" link opens the "tell-a-friend" modal. Both modals contain forms that can be submitted. The problem is if I open the first modal and submit it or close it, I cannot submit the second modal. I can open the second modal, but I cannot submit it. Please advise what the problem could be! Here below is the javascript code that resides in separate javascript
Validate dependent select boxes with validate plugin
Hi, I'm trying to validate two dependent select lists using JQuery Search Plugin, without success. The classes I've to transform in requested are sid_list1 and sid_list2. Here's the script <script text= type='text/javascript'> var $j = jQuery.noConflict(); $j(document).ready(function () { $j("#XTspSearchForm132").validate({ // other rules and options, }); $j('.sid_list1').each(function () { $j(this).rules('add', { required: true, messages: { required: "your custom message" } }); }); $j('.sid_list2').each(function
jQueryMobile prevent device switch off - Web Audio API
Hey everyone, i am currently developing an application with jquerymobile for iOS (& maybe someday Android). It is a simple app: By touching a button in a simple popup it starts to play different sounds in a loop with the html5 web audio api (e.g. touch -> sound1 -> sound2 -> sound3 -> sound1 -> sound2 ...and so on...). The problem now is when you turn off the device (iPhone) or close the app with the "home" button the sounds stops to play (or the javascript stops?). When you turn the device back
looping through <tr> then its <td>, is not working.
I tried two different codes but both don't work. Can someone help please? $("#table tr").each(function () { $(this).children("td").each(function () { alert($(this).val()); }); });and: $("#table tr").each(function () { $(this).find('td').each(function () { alert($(this).val() ); }); });I have textboxes inside of
Using a JQuery Tooltip with telerik tree
Hi, I am trying to implement a jquery tooltip for each node of a telerik tree. Please help me out.
No sorting in Array, for whatever I try
I've got following code and I dunno why the hell the output won't get sorted, as I will explain further on: /* Author: Jennifer Eberlei Project: World-Map Date: 06-02-2013 // 07-02-2013 */ $(document).ready(function() { function getWorldMapCoordinates() { var arr = new Array(); arr = [ { name: "Deutschland", numPosts: 14, coordinates: { x: 50, y: 50 }, link: "http://google.de/search?q=deutschland"
Please help Refresh div using jquery
I want to refresh div using jquery in fallowing smarty template .tpl file PLEASE HELP Script is: {include file="header.tpl"} {include file="sidebar.tpl"} <div id="items" class="main"> <h2>{$translations.titles.companies}</h2> <form action="" class="box search" method="get" accept-charset="utf-8"> <fieldset class="content"> <ul>
jQuery registration problem.
Hi, here it's my code, please help me... jQuery call: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> HTML: <form name="registerFormF" class="loginForm" method="post" action="" enctype = "multipart/form-data" onsubmit = 'checkRegisterJS( document.registerFormF.registerEmail.value,
jQuery php file outside of public_html - Need help ;)
Good Morning everyone I was wander whether I could get some help from you guys with a blocker issue I am having right now L Let me give you some background. My server file structure looks like this / HOME USER Connection Public_html Index.php resources library templates top_header.inc web_main_dir f_menu_dir
Need help asap. Jquery mobile. Not taking $ . need to get this asap. Help plz
below is my html: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>pal.html</title> <meta name="generator" content="BBEdit 16.0" /> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" /> <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script> <script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script> <link rel="stylesheet" href="navigation.css" /> <script> $(document).on( "mobileinit", function()
cannot remove 'tap' event handler
Hi I faced a problem with 'tap' event. Steps to reproduce: Attach an 'tap' event handler to some element Remove attached handler by event name ('tap') or by namespace Attach new 'tap' event handler to the element Click on element Expected: second handler is invoked Actual: both old and new handlers are invoked Example: http://jsfiddle.net/W7P5r/ Here you can see, that after clicking on "click" button one cell is added to the grid, but after clicking on "tap" or "tap.namespace" button two cells are
jquery date autocomplete
Is there anyway to use jquery to add the slash sign after writing each part of the date? Like when a user enter 02 in the textbox, jquery automatically adds the forward slash /, etc. Is it possible? If so, can someone help post the code? I'm not using the datepicker. The user fill a textbox in the form with the date.
[ask] how i can refresh single div tag without refresh the page
case : ============ a single page ==================== <div id="one">This one</div> <div id="two">This two</div> <div id="three">This three</div> =========================================== question : how i can refresh the div with id "one" without refresh the parent page? so i can update and get the result live tq all...
Check mouse left | center | right click on IE7-8
What should I use for getting the mouse click code? e.which, e .button won't work on IE7 and IE8 :(.
How to best use one jQuery version (or least amount of versions) for WordPress.
So, I'm managing a WordPress site which quite heavily uses jQuery. The site already has multiple version of jQuery and I'm not sure where to start to cleaning up this mess. I don't want to have to use noConflict every time I want to use jQuery myself, and I don't want to break the site when I trying to organise it all. Am I putting too much emphasis on standards by wanting to use only one version on the whole site? Maybe it's wishful thinking... -edit- Anyone have any ideas on how to manage this
In Scrollable.js slideshow last slide is displayed first on page load, how to resolve it to display the frist slide on page load?
I am using a javascript library scrollable.js for slideshow, in which i have 6 slides to be scrolled automaticaly but on page load i am displayed with the last slide first, then it scrolls to first slide for fraction of second and moves to second slide.. below is the code which makes this work: > HTML code: <div class="scrollable"> <div class="items"> <div><a class="fancyImage" id="protectslide" href="http://www.youtube.com/embed/EhyoS4o4_t4?rel=0"><img src="images/protect-slide.jpg"/></a> </div>
How to make jAlert as synchronous like javascript alert
In my project i am validating my form fields using jAlert() and requirement is to maintain the focus after clicking the popup Ok button, but using jAlert there is a problem of focus on the form fields that does not maintain. Please provide the solution so that i could resolve this issue.
Problem with UI Dialog - model form. It submits a form automaticly
Hi guys I have been working on this for 2 days now and I am almost done but i have a small issue. so i have 2 forms as the following structure <form action=" this page " method="post"> <button id="add-driver">Add a driver</button> <!-- this button should open the dialog only --> <input type="submit" value="add" /> </form> <form id="dialog"> </form> so the problem that i am having is that when i press the add-driver button the dialog opens with the form. but it also submits the first form! so the
put a message in select menu
how to put a message in select menu? I guess it takes a trick because the events do not show any default possibility.
Jstree always_copy not working when copying nodes between trees
Hey everyone! I am really stuck on a jstree issue; I have 2 trees a “source” tree and a “destination” tree. The “source” tree is a flat tree that contains nodes that I wish to drag over to the “destination” tree to build it out. But, after the drag I need those nodes to stay so I can reuse them. Now, if I press the control key down before and during the drag it will perform a copy function and leave the source node. But, I don’t want to have the user do this; I would like the tree to always copy.
media queries for javascript
in javascript i have given the cube size.... how to reduce the cube size for iphone screens is it possible to reduce the cube size using media queries in javascript.... how to make the cube size to 50 for iphone screens http://jsfiddle.net/XNaYj/
left arrow should change to right arrow
when i click the left arrow the slider panel opens up.... after the slider panel open up the left arrow should turn back to right arrow..... providing my code below http://jsfiddle.net/XNaYj/ $('#btnToggle').height($('#content').height()).click(function(){ $('#content').toggle(); $(this).toggleClass('btnToggleShow'); }); .btnToggleHide { background-image:url('http://intra.defie.co/images/cubes/arrow_black_l.png'); background-repeat:no-repeat; background-position:center; width:31px; height:26px; float:left;
How to get data from an already built website that doesn't have JSON plugin?
Hello All, I'm new in this wonderful world, and was wondering if anyone can advise how to get data from an already built website that doesn't have JSON plugin and display it within our App, any update to the website will be auto-updated in our App. I basically would like to know if there is a way to display data the same way like the App EURONEWS(free app), taking data from any website and feed it automatically to our App. Thanks. IC
File Image Uploader using drag and drop
Hi All, I need a help in jquery i am looking for the image uploader and editor using j_query for my website is there any plugin that might help me or please can anyone guide how can i make a one. Any help is deeply appreciated. Thanking you, Santosh Upadhayay
Bassistance validation plugin
Thanks in advance for your help! I have a form which successfully uses the bassistance validation plugin to highlight required fields. Currently all fields with class="required error" are set to always flag as required if no data entered (mainly textarea fields) The requirement now is for some questions which have a yes/no radio button. If user selects Yes the textarea asking for more information needs to be available and a required field, if user selects No this is not required. Having scoured around
JQM 1.3 RC1 posting back duplicate form data fields with empty values
With JQM 1.3.0 RC1, and also "the latest", when I do a first visit or hard refresh on a page, and enter data, the form data being submitted will not only contain the correct fields and values it's supposed to, but it will also contain an extra empty copy of the fields which is interfering with my model binding. Like this in desktop Windows 7 Chrome developer tools Header/Form Data results: DisplayText: DisplayText:231 BooleanExpression: BooleanExpression:231 submit:submit-value or DisplayText=&DisplayText=231&BooleanExpression=&BooleanExpression=231&submit=submit-value
How to set tabindex of a jQuery UI Tabs Control
I want to be able to use the tab key to tab to the jQuery UI Tabs Control, but I do not see where I can set its TabIndex. I see other posts about about the Index of the Tabs within the UI Tabs Control but I am refering to the overall TabIndex of the Control itself (within the page). Thank you.
Load First Item in List Onload
My query skills are moderate and rusty. I put together a a page that is designed to show a linkable image each time a list item is clicked. The problem is, the code I found to do so only allows one image to sow at a time. Currently, all images are hidden on load but I need the first image from each list to show upon loading. Can Someone help? The page I am referencing is located at the link below: http://cwip.com/default.aspx?page=customer&file=customer/cewhin/customerpages/informationCenter/index_Copy2_.htm
Popups with long content
Hello, I am trying to use popups (not dialogs) with the stable 1.2.0 to show some long content. There are 2 problems I am looking the answers for: 1. When I am using the default data-position-to="origin", the popup appears fine next to the origin, however when I start swiping up and down, the popup changes its position to the center of the screen. I'd like the popup to stay where it opened and doesn't change position when scrolling via a swipe. Is this possible? 2. I am using data-transition="slideup" and
Tiny jQuery problem
Hello, I have made a dropdown menu using jQuery with the .animate property. Now my problem is when I quickly hover my menu say 10 times, it will close/open the dropdown menu 10 times. How do I prevent this from happening?
Check if input,select has value after ajax submit and if not null/empty hide label
I have a multi-part form which is a CMS plugin I prefer not to hack. I am using absolute positioning for the labels to appear inside (over) each input and select elements. The following code works great for focus and blur events at any stage of the form but once the first step is submitted, any returns to the previous step(s) retain the values and result in both the label and value being present. I need to find a way to hide the labels if values are present but I'm not sure how or if I can do this
IE SCRIPT5 and access denied problem
Hi guys. i have an issue with a jquery function. in IE appear SCRIPT5 and access denied errors, everything works fine on the others browsers, and i know exactly wich part is that make the error, if i take it, the page load normal, but if dont , i just get a blank page. the bold text, is the part that i mentioned, and doesnt matter if i write .html() or .append(). some suggestions ? please. This is the script : $('.ca-item-main a').live('click', function(e){ e.preventDefault(); var href = $(this).attr('href');
Validation Plugin - v1.11.0 Remote Validation Not Showing JS Message
Hi, I am learning JQuery Validation. It's great. But I am having problems setting the message for remote validation through the rules and messages options. The message works fine when coming from the server. But I would prefer to keep all the messages together in javascript. If I do not use the server message, only 'false' appears in the error label. And the remote message set in js options is ignored. I have tried to follow the pattern found in the Milk demo. How can I fix this? The messages
problem with screen.width
Hi, I'm very new to jQuery but I have had to learn a little to make a responsive website. my problem is with the horizontal navigation menu. I want it to become a drop-down menu when the screen size is less than or = 657px. The problem is that some of the code is working (the .hide) while the rest isn't i.e the button i click to get the drop down menu to drop. I'm pretty sure I have made a really silly amateur mistake but I can't seem to figure it out. Thanks for your help. here is the code I'm using:
Running javascript animation after ajax
I have this page with includes some animation created by edge animate. Now I want to be able to load the page via ajax but still have the animation play. Does anyone know how to go abouts doing this?
Access variable outside jQuery
I am reading the content of a text file using get. The question is how to access that content outside jQuery function. The code is: var dt = null; $.get('myfile.txt', function(data, status) { dt = data; alert("alert 1 = " + dt); }, "html"); alert("alert 2 = " + dt);the first alert shows the correct content of the file, but the second one shows NULL. What shall i do in order to get the content file outside jQuery? Sorry if this question is too simple/obvious. Thanks a lot for your
My screen drags unexpectedly on iPhone listview
I wonder if anyone has encountered this issue. I have some iPhone users that when they go to touch their screen on a page that I have a listview, their entire screen moves to the left. They can touch (swipe) to move it back, but I'm afraid Apple might turn down my app based on this. I'm not even sure how to even search for a solution for this (believe me I've tried and come up empty handed). I'm not sure if this is a JQuery Mobile issue or a PhoneGap issue or what. Please any help with this would
How to ? Do this?
Im trying to substitute some hard coded code with an $each iteration. From: map.addOptimizedRoute([ {latLng: {lat:40.735383, lng:-73.984655}}, {latLng: {lat:40.763628, lng:-73.971524}}, {latLng: {lat:40.765058, lng:-73.989034}}, {latLng: {lat:40.750755, lng:-73.981824}} ]); To: map.addOtimizedRoute([ $.each($locations ,function(idx) { $locations[idx], }) Or something akin to. I dont know how many points Im going to have to have to build an array.
Next Page