creating custom drag and drop
I am trying to create functionality similar to drag and drop. I need to create my own as there will be some significant differences to that provided in the UI. I would like to have mouse move being called repeatedly at all times, and mousedown called every time the mouse is pressed. So I have the following code: $(document).bind('mousemove',function(e){ $("#coords").text("e.pageX: " + e.pageX + ", e.pageY: " + e.pageY); }); $(document).bind('mousedown',function(e){ }); As I move the mouse,
How can I add a class to a link within the .wrap
Okay guys what I would like to do is add a class to this: .wrap("<a href='" + item.link + "'></a>"); So that i can style this link .wrap("<a class="grouped_elements" href='" + item.link + "'></a>"); When i try to use the second approach i get an error that reads: missing ) after argument list Any ideas?
getJSON variable return
Hello All, If there is no data to return from the MySQL db I want to be able to return a var, noRecords, from my select.php page. Can anyone help? $.getJSON("select.php", function(data) { $.each(data, function(i, row){ $.each(row, function(i, value){ }); $('.main').append( 'html ouput' }); }); Thank you very much everyone! ;)
Issues with dynamic change of flash objects with jquery
Hi everybody. First of all i'll say that i'm a complete noob with jquery, so i'm sorry about it... I'm using the code at the end to dynamically change flash objects without having to refresh the page, but i have two problems: 1. The jquery code changes the page title to "#". Is there a way to avoid that change or to force a correct title rewritement? (i'm trying this with document.title="mytitle" at the end of the javascript function, but no way when i click anywere in the page) 2. The flash
External scripts not loading in Chrome
In my page I have a modal dialog that i use to pull in external content from another site within my domain. I pull in html content that has a document.ready function which then pulls in external js files. This works fine in firefox and ie but in chrome the document ready is not even being fired - it will only load the html content. How can I get that to work properly in chrome? Is this a security restriction?
Trying to get the width of a sub-elements
Hi! I need to get the width of a span. The page contains many (or one...) pair of jean, and the price is in a span. I need to move dynamically the position of this span, using jquery. What I do is getting the element of the table that contain the jean using JQUERY. After that, I browse all elements of this table using jquery. And I move the different div and span at their good place. But, I need to get the width of the price span. How could I do that? Firefox say that the element is Null... I tried
getting attributes from clicked anchor...
Hi, I'm new to jquery and going through my learning curve now. If I have my html (being generated by a PHP MySQL call) set up as such: <a href="javascript:void(0);" class="clickable" opendesc="<?php print $thisid; ?>"><?php print $appname; ?></a> so where opendesc will equal 1, 2, 3, 4... how can I pass this to jquery? I tried this: $(document).ready(function(){ $("a.clickable").click( function(){ alert($('a.clickable').attr('opendesc'));
Automatic Reordering of <li> elements
Hi there, I have a set of <li> elements I would like to effectively shuffle (taking the bottom one and putting it on top). What would be the best way to do this? The list - <ul> <li><a href="#">link 1</a></li> <li><a href="#">link 2</a></li> <li><a href="#">link 3</a></li> <li><a href="#">link 4</a></li> <ul> If I haven't made sense here is a static mockup. Thanks Ralph
Retrieve :hover css ???
Hey guys, I'm trying to figure out how to retrieve the .css('color') property of an element, but in its hover state. E.g. something like: $('div').css('color:hover') $('div').hover(....) doesn't work for me since I only want to retrieve it, without interaction from the user. Please gimme a hand :)
AJAX Call to Web Service Error - This page is accessing information...
Hi All, I am trying to make a web service call which returns some HTML to be rendered on the client (Code below). When the code runs, I get the following error: 'This page is accessing information that is not under its control. This poses a security risk. Do you want to continue?' I understand the browser is complaining that data is coming from another site, which may of course be insecure - Basically, a XSS/Cross Site Scripting problem. Question is - Is there a way to achieve the same result without
Problem with unbind (to bind again)
Hi all, I have a problem with unbind/bind. My code is something like $(document).ready(function(){ $("#icon_left").click(function(){ $('#icon_left').unbind('click'); //This works ok, here I prevent the user clicks while I'm executing some instructions //A lot of stuff ... ... //now the user should be able to click again $('#icon_left').bind('click'); //Unfortunatelly, I can't click :S }); }); I have no
Saving a PDF file on the server
Hi All, I'm trying to save a PDF file that's built using the jspdf PDF JS files (http://code.google.com/p/jspdf/), the example (server side) uses Jaxer to save the file to the hard drive. Can i do this via JQuery instead? PDF Example <script runat="server" type="text/javascript" src="../libs/base64.js"></script> <script runat="server" type="text/javascript" src="../libs/sprintf.js"></script> <script runat="server" type="text/javascript" src="../jspdf.js"></script> <script runat="server"
Populating a Dropdown from PHP/MySQL table and then using those to create the next Dropdown from another MySQL table
Hello all, I am a PHP programmer learning jquery (and JavaScript in general). I have a form that I am trying to create for our Customer Service people that will list the videos we give away to teachers and schools. Then once they choose the video, I need a series for new drop-downs with Category, usage, etc (each of these drop downs values, change based on the previous menu item). So the video dropdown brings up a list for the next dropdown and on and on. All the data for these dropdowns are in MySQL
creditcard2 has a bug related to SOLO, and a few VisaElectron bin ranges missing
Hi all We are currently using the credit card validation on a commercial site and I noticed a few bugs. First for SOLO. The validation for the bin range starting with 6767 is not working because of a space after the comma but before '6767': ards [8] = {cardName: "Solo", lengths: "16,18,19", prefixes: "6334, 6767", checkdigit: true}; Also for VisaElectron quite a lot of bin ranges are missing form the validation. (like for example the 491880 range). A little FYI: Latest bin ranges can be found here
slideToggle drop-down menu problems in IE8
I'm relatively new to jquery, so this might be a known issue or a simple fix, but I couldn't find any solution even after an intensive google search. Let's cut right to the chase. I have the following menu: <ul id="dropdown"> <li class="first">Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> ... </ul> with the following css-styling applied to it ul#dropdown { width:58px; padding:2px 4px; position:absolute; min-height:36px; } ul#dropdown
click() doesn't work in ie8 after upgrade to 1.4.2
Hi, I upgraded to latest jquery version and now in IE my click event doesn't fire Specifically I am trying to click a button like this, when some condition is true $('input[id*=btn_ShowReport]').click(); Any help appreciated.
Featured Content Slider Using jQuery UI
I am using Featured Content Slider Using jQuery UI and below is the code $(document).ready(function(){ $("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 5000, true); }); Its working nice, but my requirement is i want that work on mouse over, normally when u click than its change slide but i want it works when mouse over. Some thing like this on this site http://www.santabanta.com/ Please help me.
fire flame effect using jquery
Hi , I am quite new to Jquery and want to create a fire flame effect for the background of my website. Can anyone help me with that . and provide me a starting point. I would really appreciate that. Thanks
When browser scrolls new divs shouls be added
I have 4 divs displayed on the page which cover the whole content area. when i scroll down 4 more divs should be added. My question is how to get scroll event. and if user scrolls up this div should not go away.
Doubt about draggable flowchart support
Hi, We're migrating a web application currently using a legacy 2d drawing support. Our goal is to rewrite the 2d drawing using jquery (mostly native, or plugins if needed). We have to implement a flowchart like the one in this picture http://www.flowhelp.com/flowchart/make_a_flowchart.gif (just rectangles will suffice). Boxes can be easily made using .draggable(), but connecting lines and labels are another matter. Is there some support to an extended 2d drawing, i.e. a flowchart plugin? Thanks.
Problem with show funktion and display none.
Hey all Im pretty new to JQuery, but got some things working, but now I came across somthing I cant get to work, even after Googling for some time. In an XSL file I have set an onmouseover event to a function which sets different things on a div, and then displays it accordingly to where the element with the onmouseover is located. I am using JQuery function show("fast") to get a nice animation on the div when its shown. On the onmouseout I hide the div with plain style access with Javascript style.display
Div layers and Zindex
First - big ups for jquery. It rocks... now my question: I have designed a layout that has a menu in a left div layer (#left-area). When clicking on a link, it creates and opens a new div layer in the right div area (#right-area). Each of the layers is draggable, sizable etc, but my problem is that the order they are created, is the order the z-index is set as. Explained: if i open "link 1", then "link 2", the "link 2" div will always be on top of the "link 1" div. I want the ability to change the
How to block fire click() ?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <base href="http://docs.jquery.com" /> <script src="http://code.jquery.com/jquery-1.3.js"></script> <style> div { width: 90px; height: 90px; float:left; padding: 5px; margin: 5px; background-color: #EEEEEE; } </style> </head> <body> <div class="row" id="notMe"> <p>id="notMe"</p> <a href="#" onclick="alert('click 1');">click</a> </div> <div class="row" id="myDiv"> <p>id="myDiv"</p>
background image not working
hi there i have this code below if($('ul#nav li').hasClass('wp_home')) { $('ul#nav li.wp_home').click(function() { $(this).addClass("current_page_item"); });
multiple checkbox controlling one div
I have 3 checkboxes from which I wish to toggle one div. condition 1. IF any checkbox is checked, div should show 2. if all checkboxes are unchecked only then the div should hide. any help?
How to pass variables in jQuery.css({})
Hi, I'm currently using the browser detection from Peter-Paul Koch for border-radius. I added this to my code : BrowserDetect.init(); if (BrowserDetect.browser === 'Safari') { radius_b = '-webkit-border-radius'; radius_btl = '-webkit-border-top-left-radius'; radius_btr = '-webkit-border-top-right-radius'; radius_bbr = '-webkit-border-bottom-right-radius'; radius_bbl = '-webkit-border-bottom-left-radius'; } else if (BrowserDetect.browser === 'Firefox') { radius_b = '-moz-border-radius'; radius_btl
Dynamic horizontal layouts
I'm trying to create a horizontal layout for a client, the problem is that the width isn't predetermined, it changes depending on how many divs there are. You can see what I mean here: http://www.theumlaut.co.uk/wordpress/news/ I'm thinking that somehow I need to calculate the widths of all of the combined .post divs, then use that total width calculation and set it as the width for the #content div, but I really don't know how. Could someone push me in the right direction?
This code is not working
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server"> <script type="text/javascript" src="jquery-1.4.1.js"></script> <script language="javascript" type="text/javascript"> $("#<%=btn1.ClientID%>").click(function() { alert("test"); }); </script> <form runat="server" id="myid"> <asp:Button runat="server" ID="btn1" /> </form> </asp:Content>When I put the script after the form tag it works. Is that how its supposed
Suis incapable de mettre à jour ma bd
J'ai une fonction drag n drop qui va cherche le positionnement dans la bd et qui l'affiche très bien et je peut peut déplacer mes boites sans problème mais la ou j'ai un petit problème est lorsque je fait appel à cette ligne $.post('updatePanels.php', 'data='+$.toJSON(sortorder), function(response){ que j'ai mis en bleu en bas du script il ne la lit pas du tout <script type="text/javascript" src="js/jquery-1.3.2.js" ></script> <script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"
IE8 gets into SlowMo while using .animate
i build some cool animation gallery in JQuery + JQueryUI. now in FFox and Chrome it works perfect then in explorers it start to be a little slower IE6 - slow IE7 - Slower IE8 - So slow that u can't call it animation. this is the gallery: http://www.youbeaut.co.il/gallery.php?id=10 and this is the JS code: http://www.youbeaut.co.il/js/gallery.js any1 knows whats going on? btw, i tryed to add the emulate ie7 meta, still dosn't solve it.
How do I keep a file on the server, using the ajax call?
Need to read a text file located on the server. However, I do NOT want that file to be sent to the clients cache or "Temporary Internet Files". I do not want it to be sent anywhere, just to remain on the web root of the server, to be read only. How can I ensure that happens using jQuery? So far I have the below, but it still sends a copy to the client. $.ajax({ type: 'GET', url: "string.txt", cache: false, success: function(str){ alert("Data is: "+ str); } }); I noticed the ajax
what $.ajax error happened?
Hi, I have the following AJAX request: $.ajax({ type: 'POST', url: 'url', success: function(xml, status, request) { alert(status); }, error: function(request, status, error) { alert(status); alert(request); alert(error); }}); The request always returns an error (the error handling function is always called) and I get "error" for status and "undefined" for error. Could you please help me see where the problem is and what I could do to get more details about the problems? Note: the
How to get the id or other attribute value of element that caused event?
Assuming I have a set of elements with the same function attached, how do I get the ID or other attribute value of the element that caused the function to be called?
Using scroll to asynchronously change content of a Div?
Is it possible to disable the default action of the mouse scroll....and use the up and down scroll of the mouse to change the content of a Div.....(usually text)? The page would be designed to have all content 'above the fold' and scrolling down the page would not be necessary. Thanks in advance, Charles
AJAX and Basename
I posted a question recently, to no avail, trying to determine why $.ajax would work on any browser on a PC, but no browser on a Mac. Today, I discovered that $.ajax will work on a Mac if you type the url as 'http://www.domain.com' rather than 'http://domain.com'. To be clear, I have a local server set up under 'domain.com' (rather 'https://mail.domain.com' for remote email service), but the web server is at 'www.domain.com'. Can someone explain this to me? I know I can fix the issue on the server
.hasClass() not working
$("li.fusion").addClass("active"); works fine, but $("li").hasClass("fusion").addClass("active") doesn't work. In the end, I want to replace "fusion" with $(this).attr("class"), but it doesn't look like hasClass is working. Any ideas?
Help with a jQuery animation
Hi everybody, I'm new in here. I have been checking around and I have seen people here who really knows a lot about jQuery, so hope you can give me a hand. I'm new to jQuery, I have found an animation using jQuery, which I need to change just a little bit, but my knowledge about jQuery is bad so far, so hope you can show me the right direction to do what I need to. I found this tutorial here: http://web.enavu.com/tutorials/curtains-opening-animation-with-jquery/ where an animation is created. To
click() not working
I'm new to jQuery so be gentle. I'm trying to do a very simple function. User is displayed a table of Incidents. if they want to acknowledge an incident they click a button with class="delIncButton". I haven't even gotten to the Ajax part where it delete's that row out of the database. When I click on the button nothing happens. HTML <button class="delIncButton" name="2" value="2"> </button> jQuery $('.delIncButton').click(function(){ var $incID = this.val(); alert("ID =
Jquery reporting wrong x/y positions
I've updated this post to include a much simpler example. Problem: The pageX and pageY properties of the mouse event is incorrect for elements inside a <div> which is inside a <td>, but ONLY when the <div> has its css position property set to "absolute", "relative", or "fixed". This is while using jquery 1.4.2. <html> <head></head> <body> <table> <tr> <td width="100">stuff</td> <td> <!-- if style is removed from this div, the problem goes away --> <div id="tabs2" style="position:relative">
jquery gallery
Hallo I am learning using jquery but still can not write plugins and I need special one. I have experienced with jquery cycle, it is great but I need something similar - display slideshow with more than one picture displayed. I have it programmed in javascript (look at http://www.michal-jemelka.cz/art.asp?typ=new), do you know about something like that in jquery? Thanks a lot for your help
Next Page