[jQuery] My first plug in. Need comments.
Guys, I am learning JQuery (and JavaScript) in general. So I decided to write my first 'Blink' plug in. It works but can you please take a look an tell me if something is considered bad practice or can be done better. (function($) { $.fn.blink = function(options) { var opts = $.extend({}, $.fn.blink.defaults, options); return this.each(function() { var $this = $(this); var currentColor = opts.color1; $this.css({backgroundColor: currentColor}); window.setInterval(function (){DoTheBlink();}, 1000);
[jQuery] performing actions on single elements with widely used classes
Hi, I'm having trouble figuring out how I can perform say, a hide animation on a div, by clicking a button on one div, which uses a class used by other divs. *Lets say I have this:* <div class="message"> <a href="#" class="delete">Delete</a> Message text </div> <div class="message"> <a href="#" class="delete">Delete</a> Message text </div> <div class="message"> <a href="#" class="delete">Delete</a> Message text </div> *then the jquery is: *$("a.delete").click(function () { $(".overlay").hide("slow");
[jQuery] calling style
function load() { //jQuery(function($) { $("#div1").load("starterkit.html"); //}); } OR function load() { jQuery(function($) { $("#div1").load("starterkit.html"); }); } Can you tell me what is the difference between the two. I know both works. So, which one should I use. I am talking about the commented code on first snippet. Thanks!
[jQuery] [tooltip] Title attribute reload (ajax)
Hello, I'm facing some trouble with tooltip plugin. I use it on pictures for description and dynamic datas inside title attribute. Its working well. I have some criterias that client-side can choose. Once criterias are chosen, picture is changed. I would like to change as well title attribute. Actually, I'm able to reload the content of the title attribute, and dynamic datas are ok, when looking to source code. But tooltip doesn't show up, and no error occurs. I tried to change id attribute, "echo-ing"
[jQuery] Newbie: Sequencial fadeOut / FadeIn effects
Hi all, I wonder if someone here could help me with a basic js syntax I'm not familiar with. The portion of script shown below is performing a simple "hide div content" > "show another div content" when hovering on a link. It works well, but these two actions are performed simultaneously. I would like to hide first then show the div content. I've run over many script examples and solutions, and it seems that I should insert the fadeIn() into the fadeOut() function. I was not able to make this way
[jQuery] JX - Object oriented extension to jQuery released
Only 8K minified True Objected Oriented jQuery Extension Complex layouts by nesting Containers Whole application configurable 'Custom event' driven programming Extendable via Objected Oriented Inheritance. Includes the following widgets. Container, ColumnContainer, Viewport, Panel, Frame, RoundCornerBox. Tutorial, Examples and documentation. http://jx.myofiz.com
[jQuery] New plug-in: autosave
Hi guys, I've just finished building a new plug-in called autosave which is designed to save the progress of forms by saving the fields to cookies so you won't lose anything. http://rikrikrik.com/jquery/autosave/ I've not fully released it yet as I was hoping for some feedback on what could be changed or added to make it better Hope you like it, Rik -- Rik Lomas http://rikrikrik.com
[jQuery] Problems with the JSON return from the jQuery.ajax() method
Hi, I'm trying do return a JSON with a $.ajax() method. here is my entire function: function carregaMes(d){ if(!(_reunioes["reg"+d.month+d.year])){ $.ajax({ url: "reunioes.jsp", data: "mes="+d.month+"&ano="+d.year, async: false, dataType: "json", success: function(a){ _reunioes["reg"+d.month+d.year] = a; } }); return _reunioes["reg"+d.month+d.year]; } else { return _reunioes["reg"+d.month+d.year]; } } Where _reunioes is an
[jQuery] Thickbox FF problem
Hi! I'm using the iframe modal option with thickbox but i'm experiencing a problem with Firefox. The page that loads the thickbox is where i login in first place and if i leave FF with the remember password bar on top when i submit the form in the thickbox (modal) the page reloads and the thickbox closes. But if i close the firefox remeber password bar when i login, i can submit the form in the thickbox modal iframe window and it will only close when i call 'tb_remove()' function. My Code to call
[jQuery] Equal columns with a twist
Hello, I am trying to solve the following issue: - There are 3 columns on a page. - When the page first loads each column needs to be the same height (say 400px) regardless of how much content will be in each column. - The content of the column is passed in and is unknown until the page loads. - If a column’s content needs more height than 400px than a “read more…” trigger needs to be added to the bottom. Clicking the “read more…” expands the column to reveal the rest of the content. - If a column
[jQuery] How to detect when the document has changed its dimensions.
Hi everyone, I'm developing a little code that position absolutely an element in a page, but now I'm adding some events to the rest of the elements, some slides, nothing very fancy. But, now my element is misplaced because the rest of the page reacts to the change caused by my effect (this is, when an elements "slides" up, the next elements will be repositioned where my element was displayed). Is there a good elegant way to detect when the page has changed its dimensions? (not the window, the document).
[jQuery] jquery validation unhighlight issue
my js is as follows: var validator = $('#myForm').validate({ onfocusout: false, onkeyup: false, rules: { prefix: { required: true }, name: { required: true } }, messages: { prefix: { required: 'Please select a prefix' }, name: { required: 'Please provide your name' } }, errorClass: 'formError', highlight: function(element, errorClass) { $(element.form).find('label[for='
[jQuery] jqModal iframe closing 2
Ok,this is an situation. I have an page that loads over jqModal a page in that iframe, its easy for me that from that page close modal and empty that iframe with parent.jQuery('.modal1').find('#iframe').attr('src' , '').end().jqmHide(); but on that same page I also have an option to get second page where I say THANKS ... and link to close yust the same : parent.jQuery('.modal3').find('#prijava').attr('src' , '').end().jqmHide() But it has an delay in showing empty iframe. So when I click on main
[jQuery] Advanced Button Rollover
Hello, Has anyone ever seen a use of jQuery for an advanced button rollover effect such as this: The main target area is a 20x20 graphic. Upon mouseover, a 80x20 graphic appears in its place, with 60px hanging to the left over any content that happens to be there. For example: Main target area: [] Rollover state: ===[] And then, to further complicate things, both parts of the rollover state (the original 20x20 and the hanging 60x20) have their own rollover states (just color changes). I have to build
xpath with xml ajax
I am tring to retrieve a specific event from my xml document this is the code i am using: $.ajax({ type: "GET", url: "../files/events.xml", dataType: "xml", aSync:true, success: function(xml) { $(xml).find("event[datestart='10/13/2008']").each( function() { ... }); } }); the xml looks like this <events> <event id="102"> <datestart>10/13/2008</datestart> <dateend>10/14/2008 </dateend> <title>Exl Pharma - Pharmaceutical Sampling
jquery $.post firing twice on one call
Hello, I made a small device which posts data to a PHP page using $.post and dumps the echoed string into a div. My problem is even though $.post is written only once and fired only once per given interval, it's doing it twice an interval. I have tried reverting the php page to an ASP page, with no result. It's doing it twice as well on the asp page. Here's the Javascript: $(document).ready(function(){ $("div#reviewWrap div").html(""); function fetchReview(){ $("div#reviewWrap div").fadeOut(function(){
[jQuery] "on click" doesn't work!
Hi everyone! I've been trying to find the problem in the code below, but I have no idea what it is. The problem is with the "on click" option - it just doesn't work.. Can anyone please help me?!?! Thanks very much in advance.. Miri. The code: # <div id="myform"> # <h3>Do you want to subscribe to our newsletter?</h3> # # <form> # <input onclick="javascript: $('#email').show('slow');" type="radio" name="subscribe" value="1" /> # <label>Yes, I want to subscribe</label> # <br /> # # <input onclick="javascript:
[jQuery] Using search engine keywords to change page content
I have written a post on my blog with some examples on how you can get the keywords a person used to find your site and then change content on it. http://www.justjquery.com/2008/11/04/how-to-make-the-most-of-search-engine-traffic/
[jQuery] Cluetip is erasing the title attribute
Hi All, I am trying to use the latest Cluetip plugin to display a tooltip information for an image.The tooltip is displayed when the image is clicked.I am using the title attribute to inform the user to click for details and the info is stored in the desc attribute. <img src="someImage.gif" title="Click to view more details" desc="SomeTitle|Some Description"/> Everything is fine whne the page loads and when I do a mouse over on the image, it shows be the browser's tooltip and when I click on it shows
[jQuery] Google Charts
gchart can't recognize series data in barVert... can't work in var valueArray = $('#mpngicnt').text(); //80,30,50 series: [ $.gchart.series([ valueArray ], 'red')], but it works in series: [ $.gchart.series([ 80,30,50 ], 'red')], how can i solve it !
[jQuery] Survey for pro and non-pre developers
Hi everyone - I am a researcher in the Visual Studio User Experience team - I am undertaking research focused on professional and non- professional web developers. I'd really appreciate you taking 5 minutes to run through one of the survey's: Professional Developers: http://www.surveymonkey.com/s.aspx?sm=Bn4bKg_2bo49xcfXyWaNQl8g_3d_3d Non-professional developers/hobbyists: http://www.surveymonkey.com/MySurvey_EditorPage.aspx?sm=w6NaIo8sZOYGtqFZnEN5tOtvBQX0D3nQ0mDX8Sf2vbw%3d Thanks in advance! Stephen
[jQuery] Bug in IE7 - Complains about Opera bindReady code in jquery
hey all, I initially posted this on the developer forum, but not sure if that was the best place for it so reposting here. I've got an issue with jQuery in IE7. It is throwing the following error: Line: 2355 Error: Object doesn't support this property or method Looking at jquery source (v1.2.6), on that line is the Opera condition for the bindReady() event, ie: if ( jQuery.browser.opera ) document.addEventListener( "DOMContentLoaded", function () { if (jQuery.isReady) return; for (var i = 0; i <
[jQuery] order of script not right (explained inside)
I'm doing development on two sites right now. both are quite far from finished. I liked the panel script from http://www.javascriptkit.com/script/script2/dropdownpanel.shtml here and it works. You can see it here: (no this isn't advertising. almost all links are dead, there's no content and nothing to buy). http://15.e-referrer.com/cms/index.php/red/tips/ First Webiste (it works fine here) Now, I decided to add it to the next site to use just the same. It works, but the order is off and it's appearing
[jQuery] order of script not right (explained inside)
I'm doing development on two sites right now. both are quite far from finished. I liked the panel script from http://www.javascriptkit.com/script/script2/dropdownpanel.shtml here and it works. You can see it here: (no this isn't advertising. almost all links are dead, there's no content and nothing to buy). http://15.e-referrer.com/cms/index.php/red/tips/ First Webiste (it works fine here) Now, I decided to add it to the next site to use just the same. It works, but the order is off and it's appearing
[jQuery] Expert jQuery Hackers Needed
Hey all, This is a shameless post, but our company, Synacor, is in need to hire some expert jQuery hackers. We basically make internet portals for ISP's - we need some hackers who can help us do cool stuff like making page components for weather, radio, movies, etc. We have a great corporate culture and I love my job very much. If you're interested in our GUI Developer or GUI Engineer positions, please email me at mcollins@synacor.com. Thanks! --Mike
[jQuery] Hide/Show in IE 6
Will this work in IE 6? $('#listings').show(); I can't remember for sure but I thought that didn't work in IE 6. Thanks!
[jQuery] Slide out sidebars
I am attempting to design a site with a central liquid area, and two side areas that provide auxiliary information. When the browser window is made smaller and the viewport is reduced below 1024 px, I want these side areas to slide into a minimized position showing different xhtml files. when they are moused over, I'd like them to slide out to their original size OVER the main area, and graying out the main area. How would I get started? I am not a complete newbie at javascript, but this will be
[jQuery] Form Plugin - how to capture a return value?
Hello, I am hoping you can point in the right direction. I want to use the Form Plugin to post to a page which will check for an email address. That page will have a query which says the email address is found or not found (email=1 or email=2) How do I go about using the Form Plugin to check for a return value and do something if its found Yes or No? Should I not use the form plugin and go another route???Not a jquery guru yet of course.... Thanks!
[jQuery] accessing child element without unique id
I'm trying to access a td text value, as shown in the javascript below. The easiet way to solve this problem would be to give each td id value a unique identifier (i.e. td id="row1_col1") Is it possible to access the td element of a tr with a unique tr id tag without naming each td id uniquely? I'm new to this, I pasted the code as an example of what I'm trying to do. All the attempts in the javascript below failed. <html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> </head>
[jQuery] Check if remote file exists.
Is it possible to use jquery to check of remote file (url) exists or not. For example, I have this url: http://www.myserver.com/media/test.mp3 can I use a jquery http request to see if the url is valid or not?
[jQuery] validator plugin dynamic form names
Hi Jorn, Really like the plugin! How do use dynamic form names? I have tried numerous methods but it won't accept my variable. ie $("#"+MyFormName) My variable is set ok but it just does not seem to work. The reason I want to do this is because I am dynamically creating the form names from variables in php. There is also about 20 per page. A second question is how do I call my own ajax function instead of submit. The function is an <a href="javascript:etc etc > It always seems to call submit. Thanks
[jQuery] I'm having problems making a div show up when I load the page
I'm using jqModal.. I simply want an email subscription list to pop up when the page is loaded here's what I've got. <script type="text/javascript"> $(document).ready(function() { $('#dialog').jqm(); }); </script> <a href="#" class="jqModal">view</a> <-------------that is a link... I don't want to use a manual link to open up the div <div class="jqmWindow" id="dialog"> <a href="#" class="jqmClose">Close</a> Please Sign up for our mailing list: <div style="height:300px;"><form action="/email.php"
[jQuery] Clone problem in IE...
I have a frame within a window, and I have a form inside that frame. When I use clone on the FILE INPUT in that frame, it will not clone in IE. (obviously it works fine in FF3, as most things do) I looked at the code, and I think I know why. Because the clone command only reference the outside document (as in container = document.createElement("div")) It tried to copy the form element (in this case a file input) from inside the iframe to the outside document object, which isn't allowed in IE. Is
[jQuery] Can I make jquery not fail silently??
I make mistakes. Sometimes I should write code like: $("#divEditUnit_" + UnitID).fadeOut(); I expect "#divEditUnit_" + UnitID to evaluate to something like #divEditUnit_f3c23142-e933-4e13-ada3-2592893dc17c, which would be nice since I have a div with an id of divEditUnit_f3c23142-e933-4e13- ada3-2592893dc17c but instead, I goof and type $("#divEditUnit_" +UnitID).fadeOut(); +UnitID evaluates to NaN, [Thank you operator overloading!!] so I just told Jquery to go fetch a div called divEditUnit_NaN,
[jQuery] Tablesorter, sorting dates in format dd.m.yyyy
Is it possible to sort column with dates in dd.mm.yyyy format?
pasting text in table
I have a textfield in which I enter text. What I want to do is to insert the text from textfield in table column. I have no idea how I can get the text from textfield.
[jQuery] Effect Like slideUp/Down
I cannot for the life of me figure this out. I know it must be easy, just not finding the solution. I'd like to toggle() something and use the "slide" effect. However, I don't like how the UI slide effect works. It slides the content out of view then brings whatever was below up. I'd rather have whatever is below slide up with the content. Compare how .hide("slide", {direction: "up"}, "slow") and .slideUp("slow") differ. I tried using the core toggle() with slideUp/Down but that is not reliable.
[jQuery] Best event for changing the content of a div?
Hi, I want to change the content of a div asap. I know about document.ready, but if possible I'd rather do this earlier. I'd also rather do it as an event instead of loading a script file after the div appears in the page. I tried the load() event, but this didn't seem to fire at all. Anyone got any tips on this?
[jQuery] Async TreeView - loading multiple nodes
Greetings: Thank you, Jörn, for a wonderful plugin. I'm trying to load several branches asynchronously immediately when the document loads: Root | - Books - Journals - Article Databases Each one of these three is meant to load a different set of children (e.g. books.php, journals.php, dbs.php; or alternately, 'load_data.php? type=books' etc.). Forgive me, I couldn't understand from the docs how to specify the url to use in these cases - would you please point me in the right direction? Many thanks,
[jQuery] Toggle and Nested Divs
Hi all. I have an outer div that contains several child divs (event search form that lets the user pick dates, categories, etc...). The user can toggle the outer div and the child divs as well. This all works for me AS LONG AS the outer div is visible and not able to be toggled. When I let the user toggle the outer div, when the outer div is toggled to visible and the user tries to toggle a child div, the child div opens and then closes again right away. I believe this is happening because the child
Next Page