using hover with live function
my jquery was intially was $(document).ready(function () { $('ul.nav li').hover( function () { $('ul', this).slideDown(100); }, function () { $('ul', this).slideUp(100); } ); }); this works well , but
images resizing not working proper
I have a lot of images on a page and the have to be a little bit larger, so i dont want to change all of the css. I have made a couple of lines of code which doesn't give the right values back. The images have all diffrent sizes. $('.imgbox').each(function(){ var getX = $(this).width(); var getY = $(this).height(); var addX = 10; var xH = getY + addX; var xW = getX + addX; $(this).children('img').css({width: xW + 'px', height: xH+ 'px'}); });
Help with multiple jQuery in Wordpress theme!
Hello! I am very new to jQuery, and I seem to be having trouble with it.... I am creating a wordpress theme and I want each post to open in a lightbox i-frame, but since my site already has some jQuery for the basic layout [horizontal site, autoscroll, etc.], I can't get any lightbox script to work! I've tried adding it manually to the theme and even tried adding it as a plug-in in wordpress, but it doesn't work... Any ideas on how to get it to work? I appreciate any help... This is my code: <!DOCTYPE
Accordion - what am I supposed to do?
I can't get the accordion to work. I don't even know if I've forgotten something important, or if I've just made a minor error somewhere..? This is in the header: <link rel="stylesheet" type="text/css" href="css/ui-lightness/jquery-ui-1.8.11.custom.css"> <script type="text/javascript" src="js/jquery-1.5.1.min.js"></script> <script type="text/javascript" src="js/jquery-ui-1.8.11.custom.min.js"> $(function() { $( "#accordion" ).accordion(); }); </script> ¨ And this is the body: <div id="accordion">
Qaptcha does not work
Hi All, I am trying to implement the Qaptcha on my website. I downloaded the package from here: http://www.myjqueryplugins.com/QapTcha and test them. I followed the instruction carefully and still it would not work. Could someone help me out? Thanks, Ethan
simple single image hover parallax / animate effect
I am looking for a simple parallax/animate like effect, i have a single image and if i hover on it the image should move like the parallax effect. So if i put my mouse in the topleft corner the image should move in the direction bottomright. I know this i very simple but i cant seem to get it working or how to get this working. any help?
Create an array of Browser popup windows
programming beginner here. Iam doing some experiments with browers right now and I am trying to open a bunch at the same time (which i did) but i want the to be in an array to make it cleaner. I am also trying to make the pop up browsers move on click. I can make them move automatically, but i am having some problems with scope. help please :) js: // Here are the initial values for our animation. var unit = Math.round( screen.width / 8 ); var x = 0, y = 0, w=unit, h=unit; // Window position and
Loading a image before load the whole document
Hello I am working with a php in a facebook application and if I wait to load all the site take long time so my idea is to set a 'loading page..', in the mean time the php will continue working and will paste the result into a div then with jQuery I will show that div. How can I do it? Thanks
How do I pass a variable to function
Hi I am creating a testimonial/quote rotator using the following function: $(document).ready(function(){ $('#testimonials .slide'); setInterval(function(){ $('#testimonials .slide').filter(':visible').fadeOut(500,function(){ if($(this).next('div.slide').size()){ $(this).next().fadeIn(500); } else{ $('#testimonials .slide').eq(0).fadeIn(500); } }); },20000); }); That reefers to: <div id="testimonials"> <Div class="slide"> <p class="quote">Quote one here.</p> </Div> <Div
No link redirect when clicked
I have a link, say: <a href="http://jquery.com/">jQuery site</a> and when it's clicked, I don't want it to redirect me to jquery.com.
Newb Question - Fancybox and Piecemaker not working on same page - Charity website needs help
Good morning, firstly I am a total newb to Jquery and to HTML. I am running a new charity and I am having trouble with this page : www.imovecornwall.org The top section has three green tick boxes that launch Fancybox's. There is also a Piecemaker slideshow on this page. If I click on the green tick boxes at the top, it launches the fancybox script but also shows the Piecemaker slideshow over the top of it! What I need is for the onclick to launch the fancybox script BUT NOT THE Piecemaker
Newb needs help with two lightboxes on same page
Hi everyone, I have this page : www.imovecornwall.org/index.htm which has two lightboxes on it. A Peicemaker script and fancybox lightbox at the top. Problem is when I click on my icon to launch the fancybox script it displays BOTH lightboxes! Peicemaker runs fine on it's own (if you take a look at the page) HTML: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script> <script type="text/javascript" src="fancybox_multiple/fancybox/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
Loop through Repeater
I have folowing repeater. How can I loop through the Repeater and get the checked rows values <asp:Repeater ID="Rpt1" runat="server" > <ItemTemplate> <tr class="ItemStyle"> <td id="Empname" runat="server" align="left"> <%# DataBinder.Eval(Container.DataItem, "Emptitle")%> </td> <td id="Sal" runat="server" align="left" >
Looping through Repeater
I have following Repeater with some rows and checkbox for each row. How can I loop through the Repeater and get the value of only checked rows. <asp:Repeater ID="Repeater1" runat="server" EnableViewState="false"> <HeaderTemplate> <tr class="tdCellBlue" style="width: 100%"> <td align="center"> <asp:Label ID="lblEmp" runat="server" CssClass="Mandatory"></asp:Label>
Problem with events
I have 20 divs,(class point_wrapper) when i click on it, happens what follows: $(".point_wrapper").click(function(event){ $(this).css({background : '#000'}); var id = $(this).attr("id"); var nombre=$(this); var t='#'+id+'x'; var u='#'+id+'y'; $("#canvas").click(function(event){ var x, y; var posicion=$("#canvas").position(); x =Math.round(event.pageY-posicion.top); y = Math.round(event.pageX-posicion.left); var drawingCanvas = document.getElementById('canvas'); if(drawingCanvas
how to write this example?
$('.viewBookBtn').click(function() { $(this).parent().parent().find('.hideable').toggle( // just the toggle function works fine function(){ $(this).css('visibility', 'visible'); // but when defined it doesn't target the hideable classed element }, function(){ $(this).css('visibility', 'hidden'); } ); });
beginner question about the use of .has(), if and .parent()
My question is the following: I have got a little CMS (with a WYSIWYG editor) for somebody who is not familiar with HTML and CSS at all. That's why I simply can't adress classes/ids/... The issue: As I cannot adress classes/ids I thought I would search for a certain pattern <ul> <li> (<a>)<img />(</a>) <div></div> </li> </ul>now all I want to do is to do .addClass("info") on every <div> that is in the pattern. I already tried for(var i=0; i < $("img").length; i++)
setting a focus event not working
Hi experts, I am working in a third party application which has a hook into their window.onload() function.(it calls my fnCustomOnload()). In my fnCustomOnload() function I have tried to bind a focusout event on a particular input and have it call a function callled fnGetRestriction(). The function fnGetRestriction() actually works without errors, I have forced it with the grabfocus.focus() (lines 2 and 3) but it is called not being called any time other than once at the beginning when it is force
Use a form variable into another html page?
Hi, I have a form that launch a file chooser to allow the user to select a picture. On clicking submit i want to open another page and use the file the user chose and display it. Is there a way to do it without php or asp... i mean just html and jquery? here is what i have up to now: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type"
How to automatic refresh?, just one time, each time a user enters a page ...
I have a problem, I'm using a script that is okay, but sometimes, when I enter a second time to its page it doesn't load well making the markup to seem broken, it is fixed when I refresh. Any help how to make an automatic refresh after 5 seconds? Just 1 time, each time a user enters that page. Thanks in advance!
Link to Non-Mobile Page
I know this must have a simple answer but I can't seem to get a link to the non-mobile version of our site's page working. I tried the rel="external" and the data-ajax="false" but I just can't get it to load a page outside of Jquery Mobile, even target="_blank" doesn't work. Any ideas?
I want to not load plugins for pages that don't need them.
Yeah, that's an awkward sounding title, but it's the only way I could think to word it. The context I have a site with a bunch of pages. Most pages have some kind of jquery-enabled behaviour. Some don't. Some pages require the loading of plugins. Not all pages require the same plugins. The Problem I have a working, single js script for all the behaviours across my site. The browser loads a page. A plugin, say fancybox, is not required for that particular page. It is, however, required for another
Using variables instead of $(#test).html
I have code where I want to take this: $('#haveImg0').html(haveArray[x]); and use a variable instead so I can just loop through a for loop. The full code is for (var x=0; x<(haveArray.length); x++) { $('#haveImg'+x;).html(haveArray[x]); } But this doesn't work. Is there anyway to do this instead of having to individually type out all the different divs? Thank you in advance!!!!
Image viewer doesn't work on first click - but does on subsequent attempts.
I'm using the following code $(".photo img").click(function(){ var title = $(this).attr("title"); $("#display").attr({src:"photo/"+title+".jpg"});}); $("#display").css({"marginTop":"-233px"}); $("#lightbox").css({"visibility":"visible","z-index":"3"}); $("#lightbox").stop(true, false).animate({opacity:1},800); }); The idea is that whenever a user clicks on a thumbnail image which is a descendant of a DIV with the ".photo" class, the title attribute of the thumbnail image (which is just a number)
Help: Pass filter information in url
Hi, i have a filterable portfolio like this and i have a page where i say what i do called "info". I need a link on "info" page to the portfolio page that shows only one of the portfolio category. it is possible? I hope I was clear. regaerds Mattia
Link to a filtered page
Hi, i have a filterable portfolio like this and i have a page where i say what i do called "info". I need a link on "info" page to the portfolio page that shows only one of the portfolio category. it is possible? I hope I was clear. regaerds Mattia
Passing information to a .click function
I'm a JavaScript beginner but completely new to jquery - I have a basic understanding of selecting elements and performing manipulations or effects, but I'm having real trouble grasping the basics of setting up variables, performing maths on variables and biggest of all, how you go about passing information from the HTML into a jquery function. I have a site where clicking on any photo thumbnail brings up a full-screen lightbox to display the image full-size - I'm using the following to bring in
help .html() to show results from ajax call
In the code below I am trying to show the echo statement from a php file. The ajax call works when I use the alert(), but I am trying to put it in a div tag but not working. Help?? $(document).ready(function(){ //$('#email_error').hide(); $('#form').submit(function(){ var email =$('input#email').val(); var new_password =$('input#new_password').val(); alert(new_password +'and'+ email);
Adding an extra list item at the end
So let's say I have a list <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> </ul>So, when the page is finished loading, I want jQuery to add an extra list item at the end with a classname: <ul> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li class="classname">Item 3</li> </ul> How cand I do it ? :D
Passing variables via json.parse
Hi guys, Hopefully this is the place for this. I am pretty new to jQuery so bare with me please. I have a wordpress site with dropdown menus that currently are working with jQuery, now the issue is when trying to dynamically update the menus and parsing it with json.parse. For some reason I am not getting any data back of the following code (if I try to alert (data) I just get a blank box). function waitGoUpdate() { var $jQ = jQuery.noConflict (); $jQ.ajax ({ type:
Question about animate behaviour
Hello, I'm new to jquery and have been looking at using the "animate" feature to move elements around the page as opposed to CSS transitions (which I'm currently using) because jquery offers better cross browser compatibility. I have things working fairly nicely, but I've noticed that if an element is asked to animate to a position while it's already in the middle of an animation it needs to finish its current animation before it's able to start moving again to reach its new target - with CSS transitions
How would I dynamically wrap divs around inputs??
Hi, I am trying to figure out how I can dynamically wrap divs around inputs. I need to set the divs to the input's width and height and the same positions except top should be a little less compared to the inputs. Is this possible? I need to create more then one div for each input.
Dropdown using .css' visibility
Hi There I'm an absolute neewbie to jquery (and JavaScript). But already love it. Working on a new website I have added a few lines of jquery. One for the slideshow. No problems here. The other for a dropdown <div> which will show when the link 'zoeken' is clicked. However. This doesn't work the way it should and I have no idea – other than here – where to find the answer to fix it. Put in al lot of time, but no result. This is the code I used: $(document).ready(function() { $('ul #search1').click(function()
Jquery conflict with Lightbox 2 when adding "jquery.min.js" file to website
I have 2 separate things going on my homepage using jscript. One is a random bground image slideshow calling the following: <script src="../js/jquery.min.js" type="text/javascript" charset="utf-8"></script> <script src="../js/random.js" type="text/javascript" charset="utf-8"></script> accompanying HTML: <div id="slideshow"> <div id="s_show-container"> <div id="s_show"> <img src="../images/slide1.jpg"> <img src="../images/slide2.jpg"> <img src="../images/slide3.jpg">
2D images resizing, moving and pasting over another image?
Hi, I want to know if it is possible in JQuery to perform 2D images processing like scaling, resizing, moving, pasting into another image, ... etc. Im asking because we produce house doors and windows and i want to build a website to allow our clients to choose the doors/windows they want. They put a picture of their house and choose a door/window and place it over the picture and scale it to fit the actual size of the door or window on the picture. Here is a link of another door company website
Checkboxes won't get checked in the browser
Hi all, I have a really weird problem. I update checkboxes (set them to true/false) through jQuery, and their "checked" attribute gets set (when I loop through it), but the checkbox state won't show in the browser. Has someone an idea what it could be?? Here is my code: $(document).ready(function () { $('.search').find(":checkbox").each(function () { var $this = $(this); $this.change(function () { var ac = getCheckBoxClass(this);
Non-developer needs to code an Ajax-like HTTP pinger to measure network latency
I'm a network guy who uses php, bash, perl and a little javascript. Totally new to jQuery. All I need is a very simple widget that will sent a HTTP GET request to a static page on a web server, then measure and display how many milliseconds it takes to receive the response. Needs to run continuously and "ping" every 5 seconds or so. Need total basic-level help here. I'm sure it's a relatively simple widget, just dont' know how to code it up.
Accordion incompatibility with jQuery.js
Hello. I'm using this accordion. http://docs.jquery.com/UI/Accordion I take the exact same code as given and create a new file. It works well but if I simply add this (you can try): <script src="js/jquery.js"></script> I doesn't work anymore! Why?? How can this be possible? I need to use many others jQuery.js functions. Thanks a lot.
performance issue with code. please suggest
I am using the below code in my program but it seems that these few line of code is taking too much time to execute. For 100 iteration it is consuming 1 mins approx. for 200+ iteration my broser is showing a warning message that script is taking too much time. Please suggest. arr is an array cosists of div ids.Outerdiv is the the parent div of all these div ids present in arr array. arr ids cannot be accessed directly, it has to be referenced using the parent div outerDiv. for(var i=0;i<arr.length;i++)
Call function outside (function($){ })(jQuery);
Hi, I'm new to jQuery and working on a code now, I can't figure out how to call a function outside of the (function($){ })(jQuery); tags. Here is a bit of my code: <script type="text/javascript"> //Call the function from here (function($){ $(function(){ // function I want to call: function testfunction (){ //Some code... }; }); })(jQuery); </script> I need this because the function call comes from an external file in my website.
Next Page