replace multiple character in a string?
Hi, Jquery has given me the chance to learn new things on web development...I just have a question on the replace() function..... how can i change or replace multiple characters in a string. Is it possible? =) example: mystr = "i am new to jquery, it good to be updated"; char1="e"; char2="o"; in the given, i want that all "e" and "o" should have a background color, or perhaps make its font-weight to bold. Assuming that the mystr is inside <p> tag. please help.....
Problem with IE
I have this code and in Internet Explorer have a problem. I need block just special caracter(my regex), in Chrome, Opera and Mozilla It's OK, but in the IE It block all key. <script type="text/javascript"> function regexAlfanumerito(event) { var regex = new RegExp("[\sa-zA-Z0-9çÇáéíóúýÁÉÍÓÚÝàèìòùÀÈÌÒÙãõñäëïöüÿÄËÏÖÜÃÕÑâêîôûÂÊÎÔÛ]+"); if ((event.keyCode != 9) && (event.keyCode != 8) && (event.keyCode != 32)) { var key = String.fromCharCode(!event.charCode ? event.which : event.charCode);
Jquery Mobile is corrupting my button links
I have a link on my home page to go to the body armour section of the site, the URL is www.mysite.com/Body-Armour. I have a footer bar with a button on it that goes to the advanced search page. The underlying HTML shows the link on that button is www.mysite.com/Advanced-Search The problem is, JQM is corrupting the link on that button so the actual URL becomes www.mysite.com/Body-ArmourAdvanced-Search. My site uses re-written URLs and I've had a problem with images with relative paths but this was
Cycle shuffle transition problem with different sized image
Here's my attempt: http://www.lalbero.it/opt1/atelier.html My pictures are both portrait and landscape. To center them horizontally I learned I needed this markup <div id="photos"> <div><img src="pic1.jpg" alt="pic1" /></div> <div><img src="pic2.jpg" alt="pic2" /></div> ... </div> and this styling #photos div { width: 605px; height: 460px; } #photos div img { margin: auto; display: block; } I think I need to set shuffle transition left property so that it changes depending on current and next picture
Help me!what is mean "the index position of the element in the set "?
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> <!--jQuery1.81--> <script type="text/javascript" src="../../js/jquery.min.js"></script> <script type="text/javascript"> $(function () { $('input:first').click(function(){ $("ul li:last").html(function (index, oldhtml) { return "<a href='#'>" + index + "</a>" });
Validation: Clear bad fields on submit help
Can't figure this one out. I have the jquery validation plugin (version 1.9 from bassistance) successfully validating all form inputs when submit is clicked. But when submit is clicked, I also want to clear out the data on any inputs containing invalid text. Invalid inputs are assigned the class ".incomplete" $('#button').click(function(){ $('.incomplete').val(''); }); The above code makes the "Submit" button clear invalid inputs the second time it is clicked. I assume checking for
jquery validation, if condition
My form contains a label with 2 checkbox inputs (id=name, name = memtype), one of which is 'guide'. I have memtype required in validation rules with an appropriate message for failing to check a box. I also have another text input (id=sponout, name=sponout) that MUST be filled in IF memtype = 'guide'. How may I set a rule for this 'if condition' so that if a user checks memtype 'guide', but don't enter text in sponout, they receive an error message?
dynamic css attributes and values
I'm building a css animation builder and trying to populate a dynamic set of css attributes with dynamic values. I have sliders that set the values of attributes (font-size,color,margin-top,margin-left,etc.). Eventually I hope to make that part dynamic based on what attributes the user wants to modify. The key/values get written to a text area with a semi-colon separating each pair. Later in my process I need to re-apply the values that were written to the text area to the page element that is supposed
Keep accordion pane open
Hello I would like to keep dynamically the accordion menu item open in the page that has been selected from the menu items here is the code <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { // Store variables var accordion_head = $('.accordion > li > a'), accordion_body = $('.accordion li > .sub-menu');
Why is this not working with stopPropigation?
Hi, I can't for the life of me work out whats going on here :/ I have this function: jQuery(document).ready( function($) { $(document).on("click", '.add_fave', function(event) { event.preventDefault(); event.stopImmediatePropagation(); return false; alert("HERE"); }); }); ) It never gets to alert("HERE") (which is fine), yet it always then redirects of that page :/ I thought
Jquery: Calculating values form multiple select elements
code for table(mygrid) in html: <table cellspacing="0" border="1" style="border-collapse:collapse;" id="mygrid" rules="all"> <tbody> <tr> <th scope="col">Nr de ord</th> <th scope="col" class="hideGridColumn"> </th> <th scope="col" class="hideGridColumn">StudentId</th> <th scope="col">Numele Prenuele</th> <th scope="col"> <span id="mondayText">Luni<br></span>
confirmation box increments on each page refresh.
Hey guys, I must have something wrong in my code or something.. for some reason when I try to delete a post before the page refreshes than all is good, but after the page refreshes the confirmation logs it twice. here is my code. var refreshSpeed = 8000; var intValID = 0; var KEYCODE_ENTER = 13; var KEYCODE_ESC = 27; var c_hashid = new Array (), r_hashid = new Array (); function loadComments () { $.ajax ({ url: "postComments.php", type: "post",
Overflow scroll in jquery mobile
how to do overflow scroll in jquery mobile.i am trying the following code.it is not work.thanks for your help.. <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" /> <script> $( document ).bind( "mobileinit", function(){ $.mobile.loadingMessage = "Initializing";
how to re-render the ui-grid-* div
HI In my project , I need to dynamic insert/remove a div with the class 'ui-grid-a' , even I use the page('destroy').page(), It doesn't work any more ,just show me the normal text , do you know some method to solve it ? Thanks very much.
Smooth Image-to-Image Fade Transition?
Hi all, I've found a bit of code at this website: http://www.designchemical.com/blog/index.php/jquery/jquery-image-swap-gallery/ which is perfect in terms of functionality, etc. However, I'd like to make it a bit more slick and have the images fade into one another rather just change. Can anyone suggest a tweak to the existing code that would allow this to happen? Many thanks! SamB77
Local Documentation
A couple questions. The main site's link for "documentation" takes me to http://docs.jquery.com/Main_Page but it says go to http://api.jquery.com but when I go there, the top bullet on the left side is "New or Changed in 1.7". But the latest is 1.8 so I'm not sure if I'm looking at the latest documentation or not. Second, I see various ways to get local documentation but all of them are 1.7 (or older). What I really want is the style of api.jquery.com but complete and local on my laptop (because
cheking form fields with ajax
Hello, I need help for sending emails from forms with jquery/ajax method. My pb occured when I check the form fields before sending the data to the server. I have a field for the message and I check if it has at least 6 caracters every is ok if the user doesnt press enter before the 6 first caracters but a message contents header like 'Hello,' and then you rpess the enter key to go to another line. So my pb is if you press the enter key to go to the next line before having 6 caracters I have the
Loading external HTML into div
Hi, I'm fairly new to jQuery and I wanted to know how do I load three external HTML files into three different divs on another page when the body of the holder page loads. the divs would be as follows: <div id="holder1"></div> <div id="holder2"></div> <div id="holder3"></div> Thanks!
Prefetching page with MODX's Wayfinder
Hi all, I'm making a jquery mobile website in combination with MODX. Now I have two problems: 1. The website is very slow on smartphones, so the transition doesn't look nice and after the page has loaded, it's slow to. I tried to prefetch the pages. But I have no idea how I can do this when I use wayfinder. Normally you prefetch the pages with the prefetch-page code in the link. But when I use wayfinder, I don't know where I can place the prefetch code. 2. My second problem is the cufon script.
home page ipad
Hi! How can I make the following: the user enters my website. Then, on the screen appears a locked iPad and after the user drags the arrow from left to right the home page will be displayed with all the content - divs, images... The background (iPad chassis) will remain and the home page will be surrounded by the iPad. It is possible? How can I make this? Thanks!
jquery tabs& maps
Am using google map inside jquery tabs. google map is not displaying inside tabs.Please help. Below is my code. <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map_canvas { height: 100% } </style> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyBzHZOqQ2vYEd55e8NldIjmUaI8xntUzzQ&sensor=true">
How do i show current date with year?
Hello, i am new to jquery and i wanted to know that how do i show date with year ? also i want to set date next to 2 days. please share your knowledge. http://www.ndkpromotions.com
CSS3/Webkit Slider, Jquery questions
http://jsfiddle.net/xzFam/ Only works in webkit right now as I'm still working on it.. Basically, I don't know where to start with JQuery. Wondering if there is a way to make the above <ul> element infinite (or at least lots of times) without repeating it endlessly in the markup. Also, I would like the texts opacity to become transparent when it is not inline with the rest of the header..? If that makes sense. I think the first question might be a bit easier to combat than the second bit.. Thanks,
mobile.changepage to load value to the textbox
There are 2 html pages. Get data from the first page and moves to the second page. From the second page to first page using mobile.changepage want to set the values of the textbox as typed first..
Problems with scrollTop
Hello everybody, I have the following code which scrolls the page to the top if you press a link in my menu. The thing is I would only like this to work if the page is not at the top. So if the page already is at the top then it should not have any effect. How can I do that? $(document).ready(function(){ // scroll body to 0px on click $('.red ul.mega-menu li a').click(function () { $('body,html').animate({ scrollTop: 0 }, 800); return false; }); }); Best regards, Lasse
How to align header in a particular place
Hi, I'm new to this forum and jquery. I need your help on this small issue. please have a look at this link: http://jsfiddle.net/fL5c9/1/ i want to align H2 element in even pages middle. if a h2 header in odd column, it should be moved to very next even column middle. yes, it should be aligned to middle of the column and related content should follow. if it is in even column, it should be aligned to middle of the column. could you please help me on this? thanks Rajan
link in fancybox
hi, i try to ad by my pictures a link: this.title += '<a title="1st title" class="fancybox" href="http://domain/image.jpg">Link</a>'; = works fine this.title += '<a title="1st title" class="fancybox" href="http://domain/index.php">Link</a>'; = does not work. it loads the page on top. i would like the link in the fancybox. what can i do?
Getting started with basic web apps
Hi all, Up till now I've simply being using jQuery as a means of introducing small pieces of interactive content on my corporate website (banners, nav bars etc). However I'm now looking to build a small bespoke application which should be a bit more of a project.. Basically I'm wanting a 'Select your bin' feature, where a user can pick the lid and then the body of their bin of choice. Once a user has made their selection the application will output a link which will lead through to a relevant page.
Multiple sliders and last one doesnt work?? its baffling me
I am working in WordPress on an options page and everything is fine except one slider, which gets the ui-style applied, When I click on it jquey ui.js passes an undefined object on mouse move. The weird thing is all the others work fine, in fact the jquery is applied to 2 elements in the same declaration and one works but the other doesnt. I have figured out that it must be because a new jquery object is created and its not in its list of dom objects. But why this only one slider when all the others
Superfish nav-bar style doesn't work
Hey, I tried to include the Superfish menu in nav-bar style (example 4). In contrast to Joels example4 description I included "superfish.css", superfish-vertical.css and "superfish-navbar.css" as well. Until now the 1st layer comes horizontal. The 2nd and 3rd layer is vertical rendered. What I included: //link to the CSS files for this menu type <link rel="stylesheet" media="screen" href="css/superfish.css" /> <link rel="stylesheet" media="screen" href="css/superfish-vertical.css" /> <link rel="stylesheet" media="screen" href="css/superfish-navbar.css" />
Window resize event working issue on FF/Safari
Hi there! At some different points of my code I have developed some table data, wich structure is a static header and a scrollable body. The HTML code goes as: <!DOCTYPE html> <html> <head> [..] </head> <body> <div id="wrapper"> <div id="static_header"> <table>[..]</table> </div> <div id="scroll_table"> <table>[..]</table> </div>
Location function issue
So I got this on my code: $(document).ready(function(){ [...] $(funtion(){ $('div#btn').click(function(){ $(location).attr('href', '../otherHTML.html'); return false; }); }); [...] }); And dont' know why it's failing when I'm using the same strategy for other buttons and they work out. Everything around is fine, I mean, the URL's *html* file exists and so on ... - I didn't know it was imposible, so far I wouldn't
[jQuery] Styling a selectbox partially works?
Hi all, Using https://github.com/claviska/jquery-selectBox to style some selecboxes on a website, I'm running into a little problem. The tabindex of the newly created <a>element returns 'NaN'. Looking at the demo, this should be '0' (zero). Implementing the script and calling it by using $('select').selectBox();should do the trick, right? The default <select>tag is set to display none, so I'm thinking the script partially works. Only the options of the selectbox itself are nowhere to be found. Did
Autocomplete: Microsoft JScript runtime error: Object doesn't support this property or method
Hi All, I tried using the example as is given on the http://jqueryui.com/demos/autocomplete/#remote-jsonp link. It always gives me an error "Microsoft JScript runtime error: Object doesn't support this property or method". I tried this example on IE 7 and Chrome web browsers. I'm using jQuery 1.4.1.min.js, jquery-ui.min.js, jquery.ui.core.js, jquery.ui.autocomplete.js, jquery.ui.position.js and jquery.ui.widget.js I examined and found the issue while using the sample code with and without master
dynamically loading list items
The following is the sample code for loading dynamic list item but down arrow is not displaying.what i have to do for down arrow to diplay....thanx for your help <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.css" /> <script src="http://code.jquery.com/mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script>
How to use .animate() with a notification system
Hello, I'm quite a beginner with the JQuery framework. I'm building a very simple notification system showing at the top of the screen. Here is my actual script : function msg(txt) { if(txt) { $("#message").html(txt); $('#message').animate({ top: '14' }, 1000, "easeOutBounce", function() { // Animation complete setTimeout( function() { $('#message').animate({ top: '-66'
What should I use to create a JQuery/JavaScript popup?
Hey guys. I've tried searching on Google and found dozens of different popup scripts, but I'm not sure if there's any particulars one I should use. I'm trying to make the inventory system on my text game have popups when you click a item's image. The popup should have buttons that allow you to equip, eat, drop, or add to your shop. If I pre-loaded all the popups and simply made them visible, there would need to be dozens of them...so how could I make a popup system that would create the popup dynamically
back button behavior and mobile browsers
Hi, I'm trying to implement a simple back button with jqm and I can't quite get there. I'm not sure if it is a jqm issue or a mobile browser issue. I'm not using external or data-ajax=false, so I'm using the default Ajax linking. I implemented a basic back button using data-rel='back'. Unfortunately when I click back, instead of using the cached version of the previous page, Safari (iOS 5+) tries to recreate the previous page. I thought mobile browsers should do a lot of caching, but it seems to
Extracting a sub-array from multidimensional array
Hello Everyone: I've a serialized multi-dimensional array which uses keys. How can I use jQuery to extract one of the sub-arrays (as users select them) from the multi-dimensional array? Following are applicable details: Multi-dimensional array name: mail_array mail_array is serialized There are three keys to each sub-array keyMsgID keyEmail keySubject Users see a table displaying email and subject. The goal is to remove emails they select from the array. Any ideas on how to go about this are greatly
Passing variables through modal
Hey Guys, I've run into a problem where it involves passing a variable to a jquery modal dialogue upon a user clicking a link. *This also is a topic where it involves some php. Basically, at the moment i have got 2 results from a database that each have a id (24, 25). The links are displayed on schedule.php. When the user clicks one of these links, it will open up the modal (lineup.php), which will then show the id depending on what link the user has clicked. I have given it my best shot, but my
Next Page