.html() problem
I am loading some html into a div Then I need to calculate the height of the div once the html is added. My problem is that the height calculation occurs before the html is loaded sometimes. Here is my code executed at the completion of the ajax call to get the html. if (value) { $('#lmenu').html(value); pageheight(); } the pageheight function is function pageheight() { var menuheight = parseInt($("#lmenu").height()) + parseInt($("#menu").height()); var recheight = parseInt($(".ui-page-active").height());
remove form label and element
Hello! I have form with many elements. I want remove with JQuery only checkbox and his label "remove the current file" : Here bad form: <form name="sf_method"> <input type="file" name="product_category[image]" value="822db2.jpg" id="product_category_image" /> <br /> <input type="checkbox" name="product_category[image_delete]" id="product_category_image_delete" /> <label for="product_category_image_delete">remove the current file</label> </form> Here what I want to get (only file input element): <form
$.ajax with $.each
I have several divs equal with different values and I'm trying to get all the id like this: $(".compartilhamento").each(function(){ var compartilhamentos_id4 = $(this).attr("id"); var compartilhamentos_id3 = compartilhamentos_id4.split("_"); var compartilhamentos_id2 = compartilhamentos_id3[2]; }); and now I have all the ids in a var.. I use this var and sends it to a php file.. how i do it ? $.ajax({ url: "ajax/load.php", type: "post", dataType: "json", cache: false, data: {
delay string of aniations
I have a string of animations, each animation is applied to a different object i want to delay the start of each animation. I know i need to use the delay() method but i cant figure out how to create a animation que, with delays in between each animate when all of the animates are applied to a different object. if it helps what i am doing is i have a list of divs, each with different content. One is displayed at a time. I want the existing one to fade out and the next one to fade in at the same time
Matching sums to answers
I am creating a simple maths game where a grid is populated with hidden numbers. These numbers are answers. When a hidden number in the grid is highlighted, a sum linked to that answer will appear in a div. The user will then choose a number that fits in the sums answer. At the moment I am having trouble with pulling out the right sum for the answer. I do not know why but say the sum is "4-3=" the answer will not be "1". I think it is because I have not defined "answer" but am not sure. <ul style="display:none;"
Rollover - Preview Image location is variable
I am creating a simple organization chart. When you rollover a person's name, an image appears. I found an image preview script that I am using (see below). However, the image has a set offset of -20 (top) and 40 (right). This is okay unless you are near the right side of the window or near the bottom ... then the image is cut or you need to scroll. I would like the offset to be variable based on where the name is. I thought of using mouse position and setup a simple if-else statement. What
Access .NET Variables in jQuery
Can anyone please guide me to retieve the data avaiable in the .NET declared variable in the code file into the jQuery file. basically wanted to act on other controls based on the value. Raghuram
Send Post var to Jquery modale popup
I am a beginner with Jquery, I try to do some simple example to practice, In this example, I am trying to send POST var from php form to Jquery modale popup that I found on the internet. My problem is, I can't send my form var to my modale popup, when I click on submit link to send my php form, the popup appears without var in my case $name. Here my codes : Index.php: http://pastebin.com/BKnLu4xY script.js: http://pastebin.com/fYn2HZnj And finaly recep.php http://pastebin.com/cVAs8gh5 I think i
click button to change order of divs to a random order....
I have four stacked divs: <div>First</div> <div>Second</div> <div>Third</div> <div>Fourth</div> at the click of a button need to reorder the divs, at random; so every time the button is clicked the order of the divs changes to a random order.. how would I go about this.. I guess I don't need specific code, probably some cool "pseudo-code" would do..... ;-) thank you...
image swap based on relative cursor position?
Hi all, I'm learning jquery and attempting an "about us" page similar to the one seen here: http://www.abm.at/de/akteure I don't need this level of detail, but I am trying to figure out how I can swap an image based on the relative position of the cursor. I have read about the mouse tracking function, so my best guess is there's a way to filter this into another function but I am really not sure. Can anyone provide the basics of how this might be attempted? Thanks a lot
Regarding screenAvailTop
Hi Everyone, Iam wondering if i can find the distance between the screen top and div on the screen. I want only from the page top not from the window top as u know offset() gives top position relative to document but i want top position of my html element/div relative to screen(ie from the beginning of page.).PLease can some one help me from this issue.
Issue with Jquery.NoConfilct when no conflict in the page
Hi, am using jquery.noconflict method to avoid jquery library conflicting. the issue here is that when there only one jquery library at the page (that's mean there is no conflicting), the jquery.noconflict method makes jquery not working !! so how can I check in the code if there is any conficliting then use jquery.noconflict, otherwise use the regulare jquery object? please I need some help Thanks
How do I grap the href URL from HTML markup and store it in a variable?
Hi there, I'm using Jquery Mobile and I'm using this piece of code: $('#putcontent').html(output) I'm using it to put content into a data-role="content" area with an id of "putcontent". The 'output' is a small amount of HTML markup. Inside this HTML, at the end, is an anchor tag. So here's my question - how do I grab just the URL from the href and store it in a variable? Thanks for your help.
[jQuery] Draggables preventing text select in IE
Preliminary searching hasn't turned up anything, so sorry if this is a dupe; I'm still digging around. Setting a div as draggable appears to kill text selection in IE6 (I haven't checked 7 yet). Is there by any chance a way around this? If it helps anything, there is a handle specified, not the whole object, and the actual content is within a separate div inside, more or less like so: <div class="draggable"> <div class="handle"> <h2>This is the handle</h2> </div> <div class="body">
How to use a select list to show text on a page?
I have a list of films on my web page and am using a select box to allow the user to show the films by the actor they choose in the select box. However I am having trouble using the value from the select box to display the br elements with actor name. Please help am I doing the selector wrong?Ive got this to work by outputting an alert but not by showing films with the actor the user has selected. $(document).ready(function() { $("#actor").change(function() { actor is the name of my select
Fade in from left to right.
How can you make a whole div that contains both text and images fade in from left to right when page loads? Is it possible? On this website http://www.suburbia-media.com/site/ they have the effect i want but they are using flash, and it moves top to bottom. Thanks Baselitz
show elements with style display:none !important (jQuery bug?)
As said in jQuery documentation --- .show() Note: If using !important in your styles, such as display: none !important, it is necessary to override the style using .css('display', 'block !important') should you wish for .show() to function correctly. But it seems the style cannot be overridden and the element cannot be shown. http://jsfiddle.net/FF3mc/ The question has been asked at StackOverflow, I only got some alternative solutions. Can somenoe from jQuery please confirm if this is a
"time order" of elements
I'm removing an element with jQuery remove(), then add it in HTML, then check if it exists - it doesn't (length shows 0). What's going on here? Do elements exist "at the same time", although I create them serial? Background: I'm using ajax to update a part of the page. At the same time I have a dialog on the page that I want to update, too. The dialog shows debugging information from the server-side and should be from the same request processing. So, I cannot make a second Ajax call to fill just
animate .scroll
Why are not working? var tempScrollTop, currentScrollTop = 0; $(window).scroll(function(){ currentScrollTop = $("html").offset().top; if (tempScrollTop < currentScrollTop) { $("html:not(:animated),body:not(:animated)").animate({scrollTop: margintop_html+120}, 500); } else if(tempScrollTop > currentScrollTop) { $("html:not(:animated),body:not(:animated)").animate({scrollTop: margintop_html-120}, 500); } tempScrollTop = currentScrollTop; });
JQuery $ajax() Problem
Hello, I have a problem with the $ajax() function. My function looks like so: $.fn.addBooking = function(booking) { var booking_json = JSON.stringify(booking); var result; $.ajax({ type: 'POST', url: 'http://localhost/myurl.php', data: {username: "myuser", password: 'mypassword', mode: "myMode", format: "json", data: booking_json
Trouble with non-standard attribute using v1.8
I had some code that worked with jQuery 1.4 using a non-standard attribute to hold a variable. For example: <tr open="yes">~~~</tr> Now with jquery-1.8 (also 1.6 and I suppose 1.7) as soon as jQuery gets a look at it, it changes that attribute to open="open" Of course it doesn't change the source code, just what javaScript thinks the code is. Same thing happens in Chrome and Firefox. So what do I need to do to use nonstandard attributes with jQuery again?
document.ready() fired twice... Once on load and once when it's wrapped.
I have a .Net layout and a .Net control. The layout listens for document.ready() to do what it needs to do and the control also listens for document.ready() to do what it needs to do. All the layout does is wrap a shadow around it's content (this seems to be the problem) and add an IE class to the body if it's IE. document.ready() is not fired twice in the layout. The control does a bunch of stuff on document.ready, but it's only fired once if I remove the shadowWrap call from layout. If I add
Help!
I'm learning to use jquery, but am having difficulty in some fields. I have a form where the input text has an image as background <label>Label</label> <span class="Border-Left"></span> <span class="Background"> <input type="Text" name="Name"/> </span> <span class="Border-Right"></span> I wish that when the error appear, were added to the class "Error" in <span> (Border-Left, Background, Border-Right) Excuse the bad English Thanks.
Update database with $.post() and download link
Hi, I am trying to update the database as soon as a link is clicked which downloads an image But it seems not not to work with a link containing an image to download. If it is a normal text link iit works. How weird is that? Any idea? Thanks in advance. Here's some simple test code: $(function(){ $('.btn_download').click(function(){ var senddata = { action: 'change_interface', interface_value: '1' }; $.post('daten.php', senddata, function(data){ $('#console').html(data);
3 drop downs to be populated/filled up depending upon value of previous drop down
Dear All I have 3 drop downs coonected to each other http://webvikas.net.in/dropdown3/admin/3dropdown.php drop down 1 has values id=mainid Male Female Children For Male i have following Categories id=categoryid Male Category 1 Male Category 2 Male Category 3 No categories from Female and children id=subcategoryid sub category male 1-1 sub category male 1-2 sub category male 1-3 There are no categories under female and children and no subcategories for Male Category 2 Male Category 3 refer link http://webvikas.net.in/dropdown3/admin/3dropdown.php
Using Linked Buttons placing HTML PAGES into Target #CONTAINER.
Help Please! Checked many codes from Jquery samples unable to get the codes to work. I need to replace html pages into one specific #CONTAINER, after having clicked the (<ul><li>Button1</li>) this Button1 links to one html page. If successful I need to replace this Button1 (page1.html) with another (<ul><li>Button2</li>) link and place page2.html in the #CONTAINER. I have tried .load, .replace, .switch, .append. All sample codes deal with either TEXT or color changes none show how to replace an html
jquery load(): loading a javascript in to div, calls a function multiple times
I have a main div called #Content and I replace a data in the #Content based the menu item clicked: here is the code: $('.nav-button').on('click', function(e){ e.preventDefault(); $('#content').load($(this).attr('href')); }); link to my test project: http://techiedreams.com/projects/test/pearson/ UserName: amarajyothi Password: Pearson How to reproduce the problem: After logging in click on the transport then click on save, an alert will be shown once. Now click on the transport again and click on
Populating a second dropbox when the first one changes
I am programing a jquery routine that ought populate a second dropbox when the first one change. The event. Change in the first dropbox works correctly and detect when we select a diferent value. When a change occurs it invokes a PHP function (codeigniter) . This function is invoked correctly and generates the oupout as expected. The point is that this output ought to be used to populated a second dropbox and it is not happening. I'd like to know if someone can review the attacjed code and let
Request Format is invalid
Hi, I have JSONP Web service called from Javascript. This works fine for me if Web service and the code from where i am calling web service are on same machine, but if web service is on another domain then i get 'Request format is invalid' error from my web service. Both machines are on same domain. I am really struggling from this issue. Request you to provide details on this. Thanks.
Jquery Ajax Sucess data is 'Undefined'
Hi all, I am using this simple code to make ajax request. The problem is data is returning 'undefined'. The data that is returning from the asp.net generic handler is "Hello World". I don't know why and from last two days I am wondering on the web.. Earlier it was working fine. I have done all the possible solutions to get around this. if anybody can help me ...... please look into the issue... Thanks...... $(function () { $.ajax({ url: "http://localhost:51721/handler1.ashx",
Create Cookies Hide and Show DIV in JS
I have made a button <onclick="define_v();"> to hide and show the div. Now I want to set the cookies to set the last action. Here is the JS that i write. <script> var y=1; function define_v(){ if(y == 1){ comeout(); y = 0; } else if(y == 0){ comein(); y = 1; } } function comeout(){ t6 = new Tween(document.getElementById('sideslide').style,'right',Tween. regularEaseOut,-300,0,.5,'px'); t6.start(); } function comein(){ t5 = new Tween(document.getElementById('sideslide').style,'right',Tween. regularEaseOut,0,-300,.5,'px');
multiple search
i have developed flight status system and i am stuck in middle. i have four attributes for search option. how can i make the search work in such a way that when user enters only one attribute or all four to search the flight status. i am new to this please help me.
How to create a collapsible set in a foreach loop within Wordpress
I have the following code working that allows me to list the Post Categories with each category item(s) listed under relative category-title. How do I incorporate jQuery Mobile technique to collapse the category item(s) under relative titles? here is my code: <div class="wrapper"> <div class="ui-body ui-body-f"> <h3>My List</h3> <?php // cycle through categories, print 1 post for each category
Trouble getting drop down menu and slideshow to co-exist
How can I prevent my drop down menu from getting hidden behind the slideshow? http://www.bengtsson.info/aa/12/startsida.asp Any clues will be very appreciated. //T
OK - should be simple - but pulling my hair out
Hello: I'm trying to use jQuery to do a simple show(), hide().... at this point though I've been entirely unsuccessful. Goal: show() - hide() command buttons depending on what pages the users are in. There are two buttons. If the user is in survey.php the <INPUT TYPE="button" id="survey_image" class="inline_bttn"... should hide(), else the same button should show(). Once I get this goal solved, I'll want to add another command button should hide() on main.php and show() on survey.php. Following is
why doesn't my show() function work?
This is what I have for jquery: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script> $(document).ready(function(){ $get("a.project").click(function() { $("#page-wrap").fadetoggle("slow"); }); }); </script>This is what I want to show: <div id="page-wrap" style="display:none;"> <div id="transparency"></div> <div id="img-wrap"> <img src="img/project1.png" width="900" height="600" /> </div> </div>I want it to show in
How can I deactivate clicking while a function is being run?
I basically want to not let the function do anything else if something is animating. If someone clicks too often is messes up some animation I have, because the position of the last clicked element gets changed to an element it doesn't belong to. Is there a way to set a flag if the click function is running, move the animation code into its own function, and not allow the animation to run if that flag is true? Or maybe this is a bad way to go. I just need to make it safe to click around, so that
How do I loop through attr("rel") to get the one I selected.
I have a dynamic div create an image click or ipad tap. $("#pgNum").live("click, tap", function () { var v = $("#book").turn("view"); var rel = $("#pgNum").attr("rel"); var spl = rel.split("x"); var pgClicked = parseFloat(spl[0]); $("#book").turn("page", parseInt(pgClicked)); $("#ContentTitle").fadeOut(1000); $("#CView").val(v[0] + " - " + v[1]); });My c# code loads the a
Is there a better way to speed up performance ipad with images.
I have a ipad flipbook but is totally slow. link Flip book code: http://www.agflipbooks.com/tabletbook.aspx?bookid=275 I am using ajax to load the images. Jquery to append images to a div. it is very slow. If you need the code I will post.
Clone div into DOM once per click
I have the following code; $('[class*="time-span"]').on('click', function () { var modelPanel = $('.model-detail-panel'); modelPanel.clone().insertAfter('.timeline').slideToggle('fast', function () { $('html,body').animate({ scrollTop: $(this).offset().top }, 500); }); }); This inserts the 'model-detail-panel' div into the DOM after the 'timeline' class. The problem I have is that the DOM has quite a few timeline classes and this code is inserting the div after
Next Page