remove first div
Hello! using jquery-1.8.3.min.js I have two divs with same classes and want remove only first div. But nothing... Maybe someone will help <div class="clearfix pam">first</div> <div class="clearfix pam">second</div> <script type="text/javascript" > $('.pam > div:first').remove(); </script>
JQuery sortable changing size once dropped? Need some help! Screencast attached!
Hi guys! You'll have to forgive me as I'm not a coder, but I was wondering if someone would have a genral idea of what could cause an issue I'm having with a stack of sortables on my site. The idea is very simple, it's a stack of credits on a users CV. They need to be able to order credits how they see fit and thus sortables is great. It all works fine, however I have noticed that when I drag a credit up or down the list, the the credit and all other credits under it change size. Each credit is made
$.extend function {}
What does $.extend function with 2nd parameter as {} mean? For example $.extend(true, {}, Object1)
Docking/undocking effect of submenu on one page navigation
Hi there, I am quite fascinated by the navigation solution of the site https://www.simple.com . As soon as you go through the main-menu item "Meet Simple", the submenu always stays on top of the site beneath the main menu and kind of docks to the main menu as soon as it would normally disappear by being scrolled out of the viewport. And, as soon as the part of the website which the subnavigation corresponds to, is scrolled out of the view, the subnavigation gets scrolled out as well. I really, really
upload a image and display on that site using jquery and html
upload a image and display on that site using jquery and html steps i. Load the Page by clicking on a URL. ii. Click a button to trigger the Camera on their mobile device. iii. Take a Photo iv. View or Save the Photo to a file. v. Upload the clicked Photo to the POST-URL.
sortable: stop option only if item on same list
Hi, Is there a way to prevent the stop option doing something if the item was dropped to another list? Because I want to do something only if the item is from the same list otherwise I use the receive option for items dropped to another list. I've tried to somehow count the ui.sender like this: stop: function(event,ui) { if ($(ui.sender).length < 1) { if (ui.sender == null) { alert('items moved in the same list'); } } else if (ui.sender != null) { alert('items
class value not changing on jquery selector
<script> $(document).ready(function () { var radioselected; $('#radioContactTasks input[type=radio]').change(function() { $('#contacttype').removeClass("invisible"); $('#contacttype').hasClass("visible"); radioselected = $(this).val(); }); $('#contacttype select').change(function () { $('#contacttype').removeClass("invisible"); $('#contacttype').hasClass("visible");
scrollTop and scrollBottom
firstly, when scroll is down i wanna div element moves to right, when scroll is top wanna div element moves to left. how can i do that? var $win = $(window); $win.scroll(function () { if ($win.scrollTop() > 0) {$(".Ax").animate({"left": "+=50px"}, "slow"); });
Carousel with built in menu
Hey everyone, I'm trying to build a site with a carousel. The idea is I have a menu and a submenu next to eachother, then after that all the content of the concerning submenu's. I want to use a carousel than can go to the position of a certain item if you click on the items in the menu and submenu's: item1 item2 item3 item4 item5 item6 item7 ... menu_link1 submenu1_link1 content3 content4 content5 submenu2_link1 content7
upload a image using jquery and html
I want to develop a jquery based mobile technology. main task is upload a image using jquery and html ,javascript only. please give code if posible
how to check if checkbox in css class
Hi, I have gridview and have checkbox ( Asp.net checkbox) in each row. and each checkbox have class name ".grp". so, how i can check if atleast one checkbox is check in this class ".grp".
I want the tag name in the alert box.
Suppose I have a structure as below: <div> <span>hello span</span> <p> This is the paragraph </p> </div> Now I want is that when clicked on the paragraph it will alert as "paragraph". If clicked on the div it will alert as "div". Means I want the tagname in the alert box. Please help.
What is "this" in jquery? Is it a dom element or an object?
I am using "this" in jquery but have not a clear idea about "this". I recently read a tutorial saying this is a dom element as well as an object, depending upon the usage. Please make clear.
Multiple buttons on same page
I'm trying to create a ToDo list where I can add items on each day. I display all days of the week with a text area underneath the day with an Add button. I got Monday working, then I got Tuesday working, but then I can't get Wednesday to work. I'm not sure if I have a small error in my code or if I'm using jQuery wrong. Any help would be greatly appreciated. <div class="daily_todo"> <div id="monday" class="dayOfWeek"> <p>Monday</p>
Function problems using .post
I recently started using JQuery after about a 3-year lapse. Needless to say, I'm quite rusty. I have a button that, when clicked, needs to send various variables to a .php file containing the appropriate function. My issue is that the button will click, any test alerts pass the appropriate values into said alert...however nothing fires off on my .php file. I'm at a loss. The function below exists inside of the $(document).ready $(function() { $( "#buttonSubmit" ) .click(function()
Animate on hover to scale images issue
I am not sure why, but when you rollover the image fast it grows and it does not go back to it initial state. Everything seems to be working fine. Except this and when you try to move your mouse fast frm left image to the last, right image and back, everything is messed up. Here is a URL to the page http://bernerfoods.bolderimage.com/products/coffee-beverages/ $("#rollovers li").hover( function () { window.imgWidth2 = $(this).children().width();
getting post individual string
I have a query which is not getting result. $(document).ready(function(e) { $('.edit').click(function(){ $.post("selected_record.php", {company: $company}, function(data) { }); }); }); above query send company name to php page. $company = $_POST['company']; $selectedcompany = mysql_query("SELECT * FROM employees where emp_company = '".$company."'"); $comps = mysql_fetch_array($selectedcompany); $name = $comps['emp_name']; $designation = $comps['emp_designation'];
Supersized transition effects problem, help meh if u can :)
I simply want to change the effect from this silly slide in / slide out to a nice fade but cant get it to work in the .php file of my wordpress template this is the problem area i think: I would sure appreciate any advise! $tf_bg_img_next.css('left',$tf_bg_img.width()); //now slide it to the viewport $tf_bg_img_next.stop().animate({ left : 0 },1000); // I try and replace this with...and nothing :( $tf_bg_img_next.stop().fadeIn(1000);
error in CORE jQuery: a is undefined....
get error: a is undefined, in connection with jquery-ui (ah yes, my favorite..... ;-) trying to get a slider working... why am I getting this error in jQuery core... using jQuery 1.8.2 with whatever jquery-ui is latest download... (can't post example, as don't have FTP access at work..) thank you..
iBooks-like menu
I need to create a web based menu system that opens similar to the iBooks app, when you click on the icon the screen splits and the bookshelf appears with elements inside. I have seen something similar here: (http://www.ok-studios.de/home/ , click on Projeckte) however the element you click on is not highlighted, it just slides away in the background. Thanks, Sam
I'm desperate with function ( $. each ())
Hello friends. I need help to replace forEach function with $.each Original Code: //iterate list trunks/branches function listBranches(trunk) { var $trunk = $("<ul>", { "data-level": ++level }); trunk.forEach(function (branch) { var $wrapper = $("<div>", { "data-level": level }); var $branch = $("<li>", $.extend(branch.props, { "data-level": level })); if (branch.sub) listBranches(branch.sub).appendTo($branch); $branch.appendTo($wrapper);
How to find width of all images and apply them to their parent containers
Here is what I do but it does not seem to work. I use window.varName because I need to reuse them in another functions. $("#rollovers li img").each(function(){ window.imgWidth = $(this).width(); $("#rollovers li").css("width" , imgWidth ); });
How to change all "name" attributes in a cloned div?
The script below is working fine but... I need all unique "name" to send the form with php. Can someone point me in the right direction? $(function() { $('#pers').change(function() { var personsSelected = $('#pers option:selected').data('costid'); var personsDisplayed = $('[id^="customer-"]:visible').length; var personsRendered = $('[id^="customer-"]').length; if (personsSelected > personsDisplayed) { for (var i = 1; i <= personsSelected;
[jQuery] $.ajax beforeSend Accept-Encoding behavior
I'm trying to make an Ajax request, specifically requesting a non- gzipped response. Here's how I am going about it: $.ajax({ url : 'http://my.valid.url/', method : 'get', beforeSend : function (xhr) { xhr.setRequestHeader('Accept-Encoding', 'identity'); xhr.setRequestHeader('X-Test', 'foo'); } }); Watching the action with LiveHTTPHeaders in Firefox 3, I can see that "X-Test: foo" gets set correctly, but I'm still seeing "Accept- Encoding: gzip,deflate". Is this expected
Why $("body").data("n","123"); fails inside ajax success function ?
Folks, I am using .data() to store some data. It fails during my intended action. My syntax is, I believe correct because the same command/syntax works fine when it is placed elsewhere in the code. Thus, in the example below I would expect the alert to give me "123" but instead, it gives me "undefined". If I place the store request else where (inside the GetDefaults() function but external to the $.ajax request, it works. If I place it before GetDefaults() it also works. But when executed as part
Can a jsonp ajax call be done with xml?
Hello, Im trying to do a mapquest cross-domain ajax call. But, the format of json they want is not valid. They are expecting the json to be formatted as such: json={locations:[{street:"York,PA"},{street:"Red Lion"},{street:"19036"},{street:"300 Granite Run Dr, Lancaster, PA"}],options:{thumbMaps:false,maxResults:1}} http://open.mapquestapi.com/geocoding/#batchsample But this format is not valid in jquery. It even fails in the json validator website. Thusly, Im getting errors all over the place.
jquery leave domain?
Hello, i need to open a popup, when the user leaves a website. i mena the complet site/domain and not a single page. i try this <script type="text/javascript"> jQuery(document).ready(function() { $(window).unload( function () { alert('unload'); }); $('a').unbind('unload'); }); </script> but the popup appears always, when i leave the page and when i click a link inside the page What is wrong in this code?
popup
How to open popup image at body onload page
Different files of jQuery with different versions are creating issues
Hi All, We are using three different jQuery files of different version in our project. (1) jQuery-ui-custom-min-1.9.2.js - For Ajax modal popup (2) jQuery.min.js - For all other jQuery related fucntions (3) We have one Quick poll functionality placed on our site. we use jQuery version 1.4.3 with some custom code here. we are referring all 3 files on one page. Now in AJAX modal popup there is a method named "dialog". We are getting an error here. Mentioning that "object doesn't support this property
JQuery
Hi I'm trying using Jquery and Jsp page to create GUI , it's simple . here is my code, in my folder, I create a Javascript library file , which contain jquery-1.8.3.js. So, when I click <button>Get External Content</button> it will display content in demo_test.txt ,but it didn't . Can you help me?? <!DOCTYPE html> <html> <head> <script language="javascript" src="Javascript/jquery-1.8.3.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("#div1").load("demo_test.txt");
Ajax Search Not Updating Content
Hello All! code below is for a carousel of a few images. Images are inline on page body. It has next / previous navigation. It also has a search box to enable search of an image by its name. Its an ajax request to a php file that uses an array to hold the images. Navigation by next / prev works. Using ajax search displays the specific image searched for on a first search. The searched image gets loaded into the carousel and hides the viewable images in the carousel viewable area. This is desired.
change title words when the user change the browser language
hi guys, i am working in globalization for diferentes languages. i wanna know how can i change the tag (alt) and (title) for another word. like the when the broswer be in english load the normal, when the browser be in portuguese put the portuguese word. so if english load what i have in english. <img src="../images/reviews/smiley_sad.png" alt="very bad" title="Rate this clinic as very bad"/> if pt-br in broswer so will change for <img src="../images/reviews/smiley_sad.png" alt="muito mal" title="Avalie
How do I force a repaint with jquery
I have a video in an iframe that displays OK in IE, but its all dark in chrome. I find that if I switch to another tab in chrome, and then switch back, it is now displayed. So I'm thinking of forcing a repaint of the div that contains the iframe - or the iframe itself. I experimented with .show, .hide, and .toggle, but this doesn't seem to work. Anyone have ideas?
submitting a form in FF or chrome works fine IE dosnt work
<script type="text/javascript" src="system/jquery-1.8.2.min.js"></script> <script type="text/javascript"> $('#setPAGE').submit(function(){$('input[id=subaddPAGE]', this).attr('disabled', 'disabled');}); function grabPAGE ( ) { var page_title = $("#page_title"); var page_desc = $("#page_desc"); var page_content = $("#page_content"); var url = "system/JQ_addpage.php"; if (page_title.val() == "") { $("#IAC").html('<div id="JQUERY_processor_container_RED"
browser re-size issue slider out of conatiner
0 down vote favorite when i re-size the browser window the slider goes out of the main container i am using bootstrap responsive css i see the extra margin in the slider container if i remove its ok but if i still make the window smaller slider goes out how to fix the bug... http://jsfiddle.net/48y2Q/embedded/result/ http://jsfiddle.net/48y2Q/ providing my code below <div class="container"> <div id="da-slider" class="da-slider" style="margin-top: 0px; margin-bottom: 0px; height: 300px; background-position:
Open a div with a same position as a list item
How can I achive this. What I need to do is basically open a Div in position 1 when list item form position 1 was clicked. Then open a div on position 2 when list item in position 2 was clicked etd. <div id="rollovers"> <ul> <li>List item 1</li> <li>List item 2</li> <li>List item 3</li> </ul> <div id="targetCont"> <div>Content for list item 1</div> <div>Content for list item 2</div> <div>Content
How to loop using php array
I'm using a jquery color picker that adds a block of code for each color. I have changed it so it uses a predefined value from php code so it looks like this $("#<?php echo $colorsArray[0]; ?>").spectrum({ showInitial: true, showInput: true, showPalette: true, showSelectionPalette: true, palette: [ ['black', 'white', 'blanchedalmond'], ['rgb(255, 128, 0);', 'hsv 100 70 50', 'lightyellow'] ], localStorageKey: "my_colors", });
How to create a jquery poup box?
Please help me.
Applying CSS style to checked and unchecked checkbox using JQuery
Hi.. I have a group of checkboxes and I want to apply a style to checked checkbox and remove the style of all other boxes.Here only one checkbox should be cheked at a time. The code I used as follows <script type="text/javascript" src="jquery-1.7.1.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $(".item").click(function(e) { //$(".item").each( function() { $(".subscribe").attr('checked', false); var checkbox = $(this).find(":checkbox"),
Slide out problem
I have two immediate problems with the code I am working with. I have an area when I hover over it makes visible prompts to social media sites. But I don’t know how to keep the prompts visible while you choose the site that you want to visit. Secondly as the icons appear there is a small line that appears between the icons. What is this from and how do I remove it. Obviously I would like some help in resolving these two problems. The viewable link is: http://rouse.ws/promptTest/slideRightSocialTest.html
Next Page