Add an input file type field by a click of a button
Hello, I am using JQuery for the first time i need the dinamacally genarate an input file after a button. The objective is to make several uploads for files. soo here is the function: $('button.add_input_file').click(function() { $(this).after('<input type="file" />'); });my button is like this: <input type="button" name="btnAdd_upload" value="" class="add_input_file">Do i need to add more info to the button?
append jquery to get full url
I have an href tag which is basically in usercontrol ...../get.ashx?id="+id+"& "edit="+ a.edit ; But when I call this like window.aspx?url="+u.attr("href") it is giving only window.aspx?url=...../get.ashx?id="+id I need to have the edit query string also. Without that I am getting error(Of course it will come) I think I gave you enough description of my prob. Is there any way that I can append to the u.attr("href"). Please help me and it is urgent. Thanks
Sliding elements into view port on click
Hides the element by sliding it down. $("div").click(function () { $(this).hide("slide", { direction: "down" }, 1000); }); I am new to Jquery please bear with me. How do I reverse this code to slide element into viewport as opposed to slide out of view port. This is the link to the effect http://docs.jquery.com/UI/Effects/Slide What I want to do is the element will be hidden originally on loading the page and then slides into view with a click anywhere on the page, an anchor or after a few seconds.
How to change tab content on fly?? I'm Using jQuery and PHP for my web pages and I'm new to jQuery
The web pages I have created contains TABS control using jQuery. The TAB CONTENT has some FORMS, TABLES and TEXT etc.. The BEHAVIOR I want to achieve such that, after user entered data to a form (and after successful validation), data in that form should passed to some PHP pages and based on the results TAB CONTENT (same tab) should be loaded with NEW FORMS and TABLES etc... I want to achieve such a behavior for my WEB BASED PHP PROJECT. I'm NEW to jQuesry so please give any CODE EXAMPLES, LINKS
ui tab index losses focus outside function
Does any body know how to use the index value of a tab and pass it to other functions across the app.. this works as long as it is in focus of the function $(function() { $("#info").tabs(); $("#info").bind("tabsselect", function(e, tab) { var _itabnum = tab.index; alert("from link" + _itabnum); });}); ---------------------------------------------------------------- //this is what I need it to do but the var loses focus $(function() { $("#info").tabs(); $("#info").bind("tabsselect",
How to do a ajax within a ajax call in jquery?
Hi, I am working on my website I use jquery ajax and would like to know how I can inject javascript code? I know how to inject html. The problem I face is that I use jquery ajax post method and I inject html using the html.() Yet I notice the javascript code dosen't get injected. it would inject only html code. So my javascript code that once the button is click in the panel to load a form in the panel. I got a div that I will refer as a panel. At the top of the div I have a navigation menu where
how to change a src of image by number?
Hi all, I have this: <div id="holder"> <img src="/website/path_off.gif" class="test"> <img src="/website/path_off.gif" class="test"> <img src="/website/path_off.gif" class="test"> <img src="/website/path_off.gif" class="test"> </div> how, I have another js function: function activeit(number) { // here } in here I need to change the image by the number: for example: The number is 1 then: 1. ALL images are: <img src="/website/path_off.gif"
How can I get value of Json in jQuery
I have following Json string (returned from server) : [{"rurl":"Asia.com","status":1,"recordType":0}, {"rurl":"Africa.com","status":1,"recordType":0}] Iam using following code to get JSON values but Iam getting "UNDEFINED" value. I want to access "rurl" => "Africa.com" success: function(data) { var encoded = jQuery.toJSON(data); alert(jQuery.evalJSON(encoded).rurl); } Can some one guide me, what and where Iam doing wrong.
jQuery with js code fails
Newbie here. I must be doing something basic.... wrong. Windows XP, SPII; I.E. 7 Simple load of jQuery, as shown in the "How jQuery Works" doc works fine. But as soon as I add a basic function, as show in the doc, it fails on me. IE says "Object expected" in char 1 on this line: $(document).ready(function(){ I am not familiar with that construction; it is over my head. FireFox loads the page without error, but does not execute the JavaScript code. It must be something simple. What am
JQuery retrieve specific li from ul
Hello everyone, I have this problem: I wrote this simple snippet to animate a listitem from an unordered list. Here it is: function OnLoad() { $('#navigation').mouseover(function() { $(this).find('li').stop(true, true).effect("pulsate", { times:2 }, 150); }); So I have a div with id "navigation" which contains an <ul>, and the <ul> has several <li> items. What I want to do is to animate the <li> items as i rollover them. My question is , how can I only animate the
Image Sparkle Effect - Almost Working
Having some trouble with the loop and fade parts. I have a header logo that has threee png sparkle images layered just above it. I then placed an empty span over the top and sized the width/height to cover my "hover" area. What I want is when there is a hover event, the 3 sparkle png images fade in/out at different intervals and delays and to repeat this function until mouse out. (like this but not using css -webkit) What I have so far is the hover triggering the loop and the fade intervals but
Figuring out how to use a conditional statement if children exist...
So I'm new to jQuery and loving it! I just got stuck on a problem that I'm not sure how to work around. I'm trying to add a class to a li item in a navigation if it has child list items underneath it. For example, if I have this situation: <ul> <li><a href="#">List Item 1</a> <ul> <li><a href="#">Sub List Item 1</a></li> </ul> </li> <li><a href="#">List Item 2</a></li> </ul> So in this situation, since List Item 1 has list items underneath it (children), I want to be able to append a class to
Jquery switch Button Label/Value On/Off?
Hi Guys, I need a Solution to switch the Button Value/Text when pressed. Code so far: <input type="button" class="my_button" name="buttonName" value="Off" /> <p>Such interesting text, eh?</p> <script> $(".my_button").click(function () { $(".my_button").val("On");$("p").toggle("slow"); });That switches once, But how how to switch the Value to Off/On? Any Ideas? THX Dieter Asman
How to populate combo on load form !
hi guys, i am new jquery and hope someone could help me with . i am trying to configure a simpe combobox and i thought to populate it in the beginning the the form is loaded (i guess this is the best idea but any advice are welcome). unfortunately the combo is not loaded when the form is load , here is my code : html <tr> <td><label for="labelCountry">Stato</label></td> <td> <select id="country" name="country"> <option value="0" selected>Seleziona stato ...</option> <option value="1" selected>Sele
using Jquery: need help loading elements on page
I have a jquery galleria slideshow which i got to work until I placed the code into my web page. I think that the problem is that the javascript element isn't loading the images the way it's supposed to because the code is now burried within a a div tag that is not visible when the page is loaded . I believe it's this line: $('ul.gallery_demo').galleria({ that is supposed to load images into the un ordered list . gallery demo i am pretty new to javascript and very new to jquerry so I don't know were
Download jquery is nt working
Hi, Downloading JQuery is not working in my case :(
.load on div
Hey all, im REALLY new to javascript/jquery so i may have made some noob mistakes. i am trying to use the .load() function on a div and use ajax to change the content: $(document).ready(function(){ $("button").click(function(){ $('#ajax').load('ajax/home-ajax.html') } } i have a button in my HTML too <button type="button">Test</button> i have a div on the page called "ajax" but it wont change when i press the button. the "ajax/home-ajax.html" file exists too so thats not the
Deleting a Node from XML String
Hi All, $(document).ready(function () { var EmailXml = "<Set>"; EmailXml += "<Email>" EmailXml +="<Type>0</Type>"; EmailXml +="<Addr>amol@gmail.com</Addr>"; EmailXml +="<DisplayAs>Amol Mahajan(amol@gmail.com)</DisplayAs>"; EmailXml +="</Email>"; EmailXml +="<Email>" EmailXml +="<Type>1</Type>"; EmailXml +="<Addr>vishal@gmail.com</Addr>"; EmailXml +="<DisplayAs>Vishal Sathe(vishal@gmail.com)</DisplayAs>"; EmailXml +="</Email>";EmailXml +="<Email>" EmailXml +="</Set>"; var dom = LoadXmlDocument(EmailXml);
Translate this javascript to jquery- 1
How would you write this in jQuery?: ... window.onload = init; function init(){ document.getElementById("div").onclick = setBackgroundColor; } function setBackgroundColor(){ document.getElementById("div").style.backgroundColor = getRandomColor(); } function getRandomColor(){ var randomNumber = Math.floor(1+Math.random()*2); switch(randomNumber){ case 1: return "blue"; break; case 2: return "red"; break; } } ...
ready() vs $(function())
I understand that ready() will run when DOM is ready: $(document).ready(function(){ $('#div').html('Hello'); }); When will this run?: $(function(){ $('#div').html('Hello'); });
pass string from jquery to php
Can any 1 give me hints on how : to send variables (array or string) from jquery to php... I use jquery to copy/duplicate <select> box, I set to them different names and id's, and i need a way to pass the new name <select name=" ???"> to my index.php in order to do some calculations. Is this bad way to do the job? Any ideas? As far as i can see the best way would be to get <select name="???"> as soon as it's generated and that means using ajax (im not fammiliar with ajax nor js :( and i feel like
Closing Opened Items on Click of Another
I have this code that opens and closes a div on click of a button: $(document).ready(function(){ $(".explorenavopen").click(function(){ $("#explorenavholder").slideDown("slow"); }); }); $(document).ready(function(){ $(".explorenavclose").click(function(){ $("#explorenavholder").slideUp("slow"); }); }); I plan to use this functionality in a few places on the pages. To do so I want to check if something else has been opened (and not closed) and if any of the other items called
Full Size Image Window From Preview Gallery
Hello, I need some help with the code for finishing off my image gallery. I so far have a scrollable image gallery of some thumbnails, I now wish to be able to click on the thumbnails and it load the corresponding full sized image with the website and everything else behind it being darkened/dimmed. the xhtml is structured like this so far, with no links to the full size images <div class="sc_menu"> <ul class="sc_menu"> <li><a href="#"> <img src="Images\Done\Day\DSC_0425_Thumb.png" alt="Menu"/><span>example
.ajax and json response
I am having problems using an AJAX response. Here is the JavaScript code: $.ajax({ type: 'POST', url: ajaxurl, data: data, dataType: "JSON", success: function(r) { alert('Got this from the server: ' + r); alert(r.description); } }); The server uses json_encode, so the JSON is well-formed. Here is what I get from r. Got this from the server: Array ( [pid] => 1 [uid] => 0 [title] => 18 [description] => 18 [start] => 2010-06-13 [end] => 2010-06-13
toggle() stopped working after I added jquery UI
hi I have a div toggle and works fine untill I add jqueryUI library and it stops working, here is the code. <a href='#' onclick="$('#block').toggle('200');" >showme</a> <div id='block'>stuff here</div> it works perfectly untill i add : <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/jquery-ui.min.js" type="text/javascript"></script> to the header. its only toggle() which stopped, ajax and rest still work. there is no error or anything on firebug. just dosn't toggle anymore. what
How do I lock an .aspx form while processing?
Can the UI dialog be used for this?
Jquery carousel - loading images
Hi - I'm building a site that needs to have multiple carousels on one page which I can do however when you load the page it seems to load every single image on the page and show them for a second or two before formatting correctly in to their carousel. My question is, is there a better way to load the images to stop them from all appearing to begin with? This is the kind of thing I'm after www.pinnaclepromotions.com - I dont mind new methods if needs be.
insert every element into new line
Hi to all, Any idea on how to insert every new element into new line? (ATM it starts in a line and then it fills the whole line with elements, and i want to put 1 per line The element is select list: <select id="end" > <option.......>...</> </select> The button used to add new object: <input type="button" id="add" value="Add"/> This is the jquery part: <script type="text/javascript"> $(document).ready(function(){
jQuery refocuses the browser when the window is too small for the screen
I know the real problem here is that our user ought to just use a better screen resolution, but I thought I would ask in case there is a way around that. I am using a jQuery gallery that cycles through 4 images. If the screen resolution is such that the whole jQuery is showing at the same time, there is no problem, but apparently, if the resolution is set so low that the user has to scroll to the right to see the right-side of the screen, AND the user has scrolled all the way to the right to see
Broken demos in documentation
First demo of hover is broken in Firefox 3.6.3 and both demos in Safari 5.0 (using Mac OS X 10.5.8)http://api.jquery.com/hover/ First demo of mouseover is broken in Friefox 3.6.3 and both demos in Safari 5.0 Status bar in Firefox reads: Transferring data from mediacdn.disqus.com...http://api.jquery.com/mouseover/ Other demos are also broken. I posted this in bugs and the response was 'works for me' and the ticket was closed - not helpful.
Keep the form in the dialog form after submitting it incorrectly
Hi, I have this page. login: miguel@mail.com pass: m If you click on "Enviar mensaje" you can see a form. Then, if you leave empty the fields and press "Enviar" the form appears again (more validation errors) but without the modal dialog. What should i do to keep the form inside the dialog form where there is submit errors? Regards Javi
get the TEXT BOX values : not working....?
How to get Text box value on key up using jQuery. $(document).ready(function(){ var val = $('input[name=leaddaystxt]').val(); -- this i s not working. $("input#leaddaystxt").live('keyup', function() { alert text box value here. alert(val); -- this is not printing anything... }); }); HTML : <input type="text" name="leaddaystxt" id="leaddaystxt" value="" size="2" maxlength="2">
Creating an image
Hello In javascript you can write the following to create a new image which you the can insert in your document: var image = new Image(); image.src = "image1.jpg"; document.getElementById("div").appendChild(image); How would you do this with jQuery?
Is there a simple image enlarger available
Can someone point me to a plain vanilla jQuery image enlarger eg click on thumbnail and image becomes larger then click to close. The larger image should overlay thumbnail and text. Any advise greatly appreciated.
Toggle text link to change parameter
Hi All, Trying to have plain text that you can click (div of newslink) which toggles the right parameter of other element (div of rightSidebar). Set rightSidebar initially with css: #rightSidebar {right:200%} Here's what I have for script, but still not working - suggestions?: <script type="text/javascript"> $j(document).ready(function(){ $j('#newslink').toggle( function() { $j('#rightSidebar').animate({right:'0%'},1000);
Superfish menu tutorial
Hi I've been trying for hours to get superfish to work. Been to there site is there anywhere with a comprehensive tutorial on it. thanks
Problem clicking on an image and getting the target.href
I'm having a problem with this code: $('nav a').click(function(e){ e.preventDefault(); alert(e.target.href); }); Here's the code for the nav <nav> <li> <a href="somepage.html"><img src="someimage.jpg" /></a> <a href="somepage.html">Some text </a> </li> </nav> When I click on the text, the I get a URL as the target.href, but when I click on the image, I get undefined.
Draggable Problem
hi, i'm new to jQuery/Javascript and am having a problem with the draggable feature in UI. everything works fine when i test the site on my local host but when i access it on the web, the absolute positioning of the draggable windows seems to function as if they were positioned relatively. it also works fine when i take away the javascript so i'm guessing that is where the problem is. like i said, i'm entirely new to javascript so i'm probably not doing something quite basic. here is the javascript:
How do I make a webpage have a transition when moving to another page?
The transition could be anything but I'd most like it if it was the fade in / fade out effect... Thank you for those who'd answer my noob question...
How to make drop-down menu not close when changing pages ?
Hi everyone. I'm using jquery to make a drop-down menu on a website i'm wotking on. I'm currently using the following code, and it's all working allright: $(document).ready(function(){ $(".btn_slide").click(function(){ $("#sub_categories").slideToggle("slow"); $(this).toggleClass("active"); return false; }); });Inside of this slider menu, i have 4 more options all of them using the same type of slider code. The thing is, when
Next Page