[jQuery] storing objects in jQuery data
I am storing js objects using jQuery.data eg. var newDeployment = { server: server, application: application, references: references }; $('select#something option:first').data('value', newDeployment); The problem is that I then want to get a copy of that value, to modify, and store elsewhere, but it is like I am getting a reference to the object, since if I say var newVar = $('select#something option:first').data('value'); newVar.references = newReferences; it's updating
[jQuery] Jquery coding direction
I'm having problems wrapping my head around how to code this: I have two textboxes both are required. However if a user fills out one of the textboxes then the other is no longer required. Any suggestions? Thanks Tom
[jQuery] Superfish with bgiframe does not cover position:relative div in IE
Hi, I'm fairly new to jQuery and not a terribly strong JavaScript guy. I was excited to style up my own Superfish (http://users.tpg.com.au/ j_birch/plugins/superfish/) navigation menu, and it even looked good in IE! But my current design requires a div with a position:relative below the navigation on a few pages, and this causes that div to show through my Superfish drop-down in Internet Explorer 6 and 7 (Firefox on both Linux and Windows looks great still). If anyone could help me out, it would
[jQuery] Tabindex not working in Firefox on load of page
I've written some code to be able to set the tabindex automatically in our pages. It looks like this: $(document).ready(function() { var el = $(".fieldsetDiv"); if (el.children().length == 0) { el.remove(); } //setting tabindex automatically var totalDivs = 4; var divNumber = 1; $('form').each(function() { $('.fieldsetDiv').each(function() { var fieldNumber = 0; $(':input', this).not('input[type=hidden]').each (function() { var $input = $(this); if (fieldNumber == 0) { $input.attr("tabIndex", divNumber);
[jQuery] Feature request - fadeToggle
I'd like to suggest a small feature, having fadeToggle() (similar to toggle() and slideToggle()). Thanks! Erik
[jQuery] My toggleClass is not working.
Hello, I'm a beginner with jQuery. My function is not working. <b> jQuery:</b><b> </b> $(document).ready(function() { $("a").filter("#click").click(function(){ $("div .six").toggleClass("div .two") }).end() }); <b>HTML</b> <ul> <li class="six"><a href="#" id="click">Click</a></li> </ul> Help-me plz. Tks :)))<br clear="all"> -- Thiago Silvestre Web / Design / Illustration Portfolio: <a href="http://www.thisilver.com">http://www.thisilver.com</a> Msn/Gtalk: <a href="http://thisilver.com">thisilver.com</a>@<a
[jQuery] ajax calls not happening wth jquery ans asp.net 2005
hi, am trying to call a server function like this $(document).ready(function (){ $('#Button1').click(function() { $.ajax({ type: "POST", url: "remotefunctions.aspx/Test", data: "{'str':'1'}", contentType: "application/json; charset=utf-8", dataType: "json", error: function (xhr) {alert(xhr.statusText);}, success: function(msg) { //alert(msg); var result = msg; alert(msg) alert("hI"); } }); }); }); [WebMethod()] public string Test(string str) { return "-1"; } am unable to get any results frm server...also
[jQuery] [OT] form input field value
I've got a text field (named searchParam) that onkeypress will trigger a function that will extract the field's value using $ ('#searchParam').val() and use that value to be used in a database query. I've noticed that when I'm typing the value, the JS code is one step behind. That is, if I've typed a string that says foobar, the database is given the string fooba. If I've deleted the string to say foo, the database is passed the string foob. Has anyone seen this before and figured it out? tia, -
[jQuery] How to improve your Search Boxes with jQuery
Hi there guys! I want to share with you a new tutorial focused on adding some functionality to search boxes of our websites: http://yensdesign.com/2009/01/improving-search-boxes-with-jquery/ It shows you how to make: - Autofocus when the DOM is ready. - Highlight a search box when it gets the focus (remove in the blur event!) - Autoreplace the default text when needed. Thanks for reading and I hope you find it useful, as always!
[jQuery] Page reloading when modifying DOM
Dear All, I have noticed flash components in the web page reloads when I modified DOM using “append”. This is only happens in Firefox 2 and 3. Although in Firefox 2 entire web page, get refresh when I try to do that. Here is a sample code snippet. $("div# wrapper ").append($("span#floating_panel_holder").children()); I’m highly appreciate if you can look in to this issue. Thanks
[jQuery] Selecting coordinates in a page
Im trying to do something like this: joe would click somewhere on the page, type in a message and hit submit/enter. all of that is done with javascript. javascript also figures the X/Y coordinates on the page and then sends an AJAX request (would best in JSON format) saying user Joe wrote "Hello World" at X: 23 and Y:100 Is there something like this plugin at http://odyniec.net/projects/imgareaselect but for selecting a specific area on a page (not an image) ? Basically, I would need X1, Y1, X2,
[jQuery] What does "el" mean in jQuery code?
My question to you seasoned jQuery veterans is this: Throughout the many plugins I have devoured while attempting to learn all of the secrets/gloriness of jQuery, I constantly run into something like or close to <code>function(el){ //Code Here }</code>. I'm guessing el is short for element and it's a variable of some sort, but knowing my luck with programming anything, I'm completely wrong. I've searched Google all night, but to no avail. Any help would be great, thanks! P.S. On AIM, my SN is benstockdesign.
[jQuery] $(document).keydown only works in FireFox?
Hello, i tried to use jQuery for cross browser compatibility...I want to execute a click on a Button when Enter got pressed on page... but the following script still only works in FireFox and not in IE. can anyone help me or have an idea? <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { $(document).keydown(function(evt) { if (!evt) evt = window.event; if (evt.keyCode == 13) { // alert("enter captured from IE"); $("btnCanelEditUser").click();
[jQuery] How is it possible to have click on each 'a href' menu item and ALSO have another 'a href' trigger as well?
Hi... ALL the following occurs on ONE page of markup with ONE css file. [OBJECTIVE: when I click on my menu items I need another 'a href' to ALSO trigger it's link event. I COULD put the second set of link somewhere visible out of the way, though I just need them to be invoked, one for one for each of the menu items. So: have menu with 12 items and when each item is clicked need one of each of the second set of basic 'a href' link to happens also. One to one relationship. 12 seperate menu items for
[jQuery] Equivalent of the Prototype Create.Class()
I'm converting some Prototype javascript and have almost completed it, but am running into an issue with the Class.Create() Prototype method. In prototype: var DatePicker = {}; DatePicker = Class.create(); DatePicker.prototype = { initialize:function(triggerElement, formElement) { ... allows the above to be called like this: var myPicker = new DatePicker($('aDate'),$('testDate')); Is there a way in jQuery to either simulate the above or do what it intends, which is to have multiple DatePickers on
[jQuery] Absolute Image location
I am trying to run a javascript for a dropdown menu, I need to access the down.gif from images/down.gif , I have two links from where I need to include this javascript one link is in index.jsp in root folder and other is /admin/list.jsp. Now the question is if I access the images with location images/down.gif, I can access it from my index.jsp which is in root folder but my admin/list.gsp is able to access these images. How do I specify the absolute path, so from any level my javascript can access
Checking entries one by one
Hy all, I was wondering if you could help me with a little problem. I have a script that checks the status of multiple usernames at a time but as the list gets bigger and bigger the page load time becomes very long. I want to determine the script to check a username at a time, at first the #1 username is checked, after the status is returned the #2 username is checked and so on... Some thing like this but ran for each username, one by one, you get the idea. Oh, and by the way, the usernames are stored
[jQuery] i think i fix some bug
i think i fix some bug,now it can work well in ie,bug in ff still has some bug when ff window's width is too small. see here // bind key and mouse events bind(1, el, opts); if (full) { pageBlock = lyr3[0]; pageBlockEls = $(':input:enabled:visible',pageBlock); if (opts.focusInput) setTimeout(focus, 20); } else { center(lyr3[0], opts.centerX, opts.centerY); } //fix center: use Alexandre Magno's Center Plugin ,I added lyr3.center({vertical:false}); //fix blockPage cann't full over whole
[jQuery] Fade in and fade out plug in?
Hello, Does any plug-in like this exist?: I have several <div>'s on a page. There is a menu on the page that corresponds with each <div>. Initially, there should only be one <div> showing. When the user clicks a menu item, the corresponding <div> fades in. When the user clicks another menu item, the current <div> fades out and the new <div> fades in without a cross fade. The existing <div> should fade out completely before the new <div> fades in. I went through the plug-ins list and found some that
A question of JQuery
Ok having lauded the benefits and capabilities of jquery, I have received the following request for a mouseover effect: Well, I was thinking that we could have a great swoosh of stars that sprinkle around the button and then a beautiful, mesmerising, scantily clad woman could step out of the screen, take the user by the hand, beckoning them to click the button to ask a question. Once clicked, the user would be transported in a vortex to another world, where a whole host of other stunning beauties
[jQuery] superfish menu question
Hello, I have installed the Superfish Menu module on my Joomla site. I have edited the css to match the template being used, but I am having a problem with the menu pushing page content to the right. Here is an example: https://dms.converse1schools.org/index.php?option=com_content&view=article&id=3&Itemid=7 Any suggestions would be most appreciated. Thank you, J
[jQuery] example on site, have question
I'm trying to figure out how this works. It appears it is re- iterating the click function in this call. Why would this work? I don't see how I would know to create the method this way if I was going to recreate this. $(document).ready(function(){ $(document.body).click(function () { $(document.body).append($("<div>")); var n = $("div").size(); $("span").text("There are " + n + " divs." + "Click to add more."); }).click(); // trigger the click to start });
[jQuery] Custom Events on Non-DOM Objects
I noted that firing custom events seems to work on any object, for instance: var myObject = {}; $(myObject).bind(...) $(myObject).triggerHandler(...) Simon Willison had written a tutorial that mentioned using "document" instead for that purpose, and I seem to recall yet another mention of using $("*") or something like that. What is the recommended best practice for custom events? Is it okay to bind them to non-DOM javascript objects (and are there any downsides to doing so)?
Replace a text with image.
I'm trying to replace texts in table with pictograms. So, $(table.classname tr td).each(function() { }); but what to do next? Sample td: <td>Here is some sample text, and some more text is here.</td> What i need is to replace all "text" words in all td's with something else ("changed" 4 example).
[jQuery] a possible selector bug in 1.2.6 solved in 1.3.beta2
strange, i was fighting against a bit of code where the selector engine would not want to behave as i expected. Out of ideas, i tried using the freshly released jquery 1.3 beta 2 and it turns out the engine now works as i expected! here is the incriminated code: var $thisLI = $('#' + UI.section); if ($thisLI.length > 0) { var $thisMenu = $thisLI.parent(); var $thisA = $('a:first', $thisLI); $('a.selected', $thisMenu).removeClass ('selected'); $thisA.addClass('selected'); var liIndex = $thisMenu.children('li').index
[jQuery] Superfish problem in Firefox (cutting off menu) but not iExplorer?
Screenshot of problem: http://img.photobucket.com/albums/v154/lalib786/screenshot.jpg Hi Guys. Im creating a site in Joomla version 1.5.8 and am quite new to it. I am quite new to this all so sorry in advance if I ask anything stupid. So the problem I am having is with the top navigation menu called "superfish dropdown menu". So in Joomla version 1.5.8, I did the usual plugin install etc. I did get it to work BUT the problem I am having is that in internet explorer it looks fine but in firefox for
[jQuery] how difficult is it to prevent draggable() artifacts?
I've noticed that complex layouts inside of the draggable() target or embedded flash objects leads to temporary graphical artifacts when dragging the target element. This is the case in FF3 at least, so I imagine it's not much better in other browsers. How have others dealt with this problem?
[jQuery] Superfish problem in Firefox (cutting off menu) but not iExplorer?
[img]http://img.photobucket.com/albums/v154/lalib786/screenshot.jpg[/ img] Hi Guys. Im creating a site in Joomla version 1.5.8 and am quite new to it. I am quite new to this all so sorry in advance if I ask anything stupid. So the problem I am having is with the top navigation menu called "superfish dropdown menu". So in Joomla version 1.5.8, I did the usual plugin install etc. I did get it to work BUT the problem I am having is that in internet explorer it looks fine but in firefox for what ever
[jQuery] Hide / show password field with focus
Hi, I've put together a couple of small functions to handle the removal / restore of the default text inside some text inputs. One of these inputs is a password field. I'm showing the user a standard text field containing the text 'Password'. When the user clicks in the box the standard text field is hidden and a proper password box is show. The following works fine: $('.login_input').click(function() { if(this.value == this.defaultValue) { this.value = ''; } if(this.name == 'fake_pass') { $('.header_login_right_fake').hide();
[jQuery] parallel inclusion dojo-storage+jquery
hi, we are using jquery but we need functionality of dojo-storage (jquery doesn't seem to provide yet). has somebody tested whether there are bad influences including both libraries at the same time? thanks
[jQuery] inArray doesn't work in jQuery 1.2.6
Hi, I need to check if a value is in a array. I tested it with json data and also with the example from visualjquery.com. inArray returns every time "-1". Is it correct that inArray doesn't work? Is it a bug? Best regards
[jQuery] Advanced Ajax Image Slider
Hello, I am trying to put together an ajax image slider that allows the user to specify a title for each image. I have a mockup located at http://static.spartaninternet.com/sandbox/slider-example.jpg When the user clicks the next/previous arrow, two things should happen: 1) the image should change to whatever the next image is 2) the titles should advance (as in a carousel) so that the current image's title is in the middle I've spent a lot of time researching scripts that could possibly do this
Help!! I am stucked with my accordion css
Hi to all members, I am new at the forum and I have a big problem: I want my jquery to look like this: http://www.3dmagicaldesigns.com/3dmd_we ... pping.html it is a jquery sample that I installed, but once I tried to install it on the original page where I need it, it seems that I can't make any changes on it, please take a look: http://www.3dmagicaldesigns.com/3dmd_we ... .php?cat=1 What do I need to do to change my jquery css styles, please help!!, I've been trying for more than 10 hours and it
[jQuery] Can I use a selector instead of this fn to check for .jpg?
Hi all, I have a function that determines (a bit hackily!) if an image is a jpeg. isJpeg=function(src) { mySplit=src.split('.'); extension=mySplit[mySplit.length-1]; isJpg=(extension=='jpg' || extension=='jpeg' || extension=='JPG' || extension=='JPEG'); return isJpg; }; I think I might be able to rewrite this as a JQ selector involving the image's src attributes, something like: $('img').filter("img[src*!='.jpg']") But I can't get this to work- and I'm
[jQuery] <base> tag breaks jquery pagination
I have jQuery pagination working in my search results, however, I hit a snag when trying to view the next page's results, because of my <base url> integrating this into my page and the pagination is showing up, but the links are broken because I am using a <base> tag. For example: Normally the pagination links (previous, 1,2,3, next) to this: search-results.php# But with the base url implemented on the page, it looks links to this: http://localhost/project/# So now when I click the pagination to
[jQuery] Complex Ajax Image Slider
Hello, I tried posting this once before but the post doesn't seem to be appearing after many many minutes. I am trying to put together an ajax image slider that allows the user to specify a title for each image. I have a mockup located at http://static.spartaninternet.com/sandbox/slider-example.jpg When the user clicks the next/previous arrow, two things should happen: 1) the image should change to whatever the next image is 2) the titles should advance (as in a carousel) so that the current image's
[jQuery] Complex Ajax Image Slider
Hi There, I am looking for a slider script which cycles through images while at the same time cycling through a list of tags associated with those images. I've posted a mocked up example at: http://static.spartaninternet.com/sandbox/slider-example.jpg When the user clicks the "next" button, the next image should display and the tags should advance (like in a carousel) so that the current image's tag is in the middle. Since there could be quite a few images, I am looking for an Ajax-type solution
[jQuery] Select first sibling
Hi How do get to select the FIRST sibling ? The problem with this is that it fades out all the siblings. <dt> <div> <a href="#" onclick="$(this).parent().parent().siblings().fadeTo (1500, 0.3);">Click here</a> </div> </dt> <dd> </dd> Thanks
[jQuery] Proper way of binding/unbinding event in plug-ins
Is the following syntax the proper way to bind and unbind event in plugin so that you minimize the chance you will unbind and event that you did not set? $(selector).bind('event.custom_tag', function); so if you take the following: $('#binding_test').bind('click.part1', function() { alert('part1'); }); $('#binding_test').bind('click.part2', function() { alert('part2'); }); $('#binding_test').unbind('click.part1'); at the end of the code click.part2 is still working but the other
[jQuery] A question regarding jquery object
Hi all, I have a question regarding jquery object: if I bind my plugin like this: $('#myButton').myplugin(); And inside my plugin, I want to bind ajaxForm listener to all forms inside 'this' current element, what is the best way to do it? I can get the id by using $this.attr('id'), but there is no guarantee that the users will always pass in an id. (function($) { // // plugin definition // $.fn.myplugin = function(options) { // bind ajax form to 'this' }}); Thank you for your help and suggestions
Next Page