First try at a jQuery plugin for event adding
Hi all, Just after some guidance or suggestions as to weather I am on the right track, style etc. I wanted to be able to insert an event at the top of an event stack in the new jQuery-1.4.2 special event handler. I have written the following which accomplishes this for me, but want to know if I'm "doing it right". (function(jQuery){ function modalEventAdd( obj ) { obj.origType = obj.type; if (obj.type.indexOf('modal') != -1) { obj.type = obj.type.split('modal')[1]
Multiple instances of plugin
Hey there, I'm trying to figger out how to make a simple plugin, and make it work for multiple sections on my current project. Let's say, I've got two sets of images that I want to horizontally scroll when I click on there own navigation-arrows. The markup could look something like this: <div id="container_1" class="container"> <div class="nav"> <a href="#" class="prev">previous</a> <a href="#" class="prev">next</a> </div> <div class="item"><img src="" alt="" /></div> <div class="item"><img src=""
Validation : validating field on depending on value of another field
I want to validate a input field if check box is checked. How can I do this in jQuery Validation. followig is form: [checkbox] Paid user Credit Card: [input box] In above, I want to validate input box if Paid User check box is clicked.
Event-Transparent Div
I'd like to create an "Event-Transparent" pluggin. Basically you give a div or whatever a class of event-transparent, and all events that would go to the given div instead go to whatever is beneath it. Why? For me I have a div that has a moveable map inside it, and some css effects and other divs inside it that add shading around the edges, so that as the map reaches the edges it fades out. The problem is that none of the events done on the shading get through to the lower layer. I have other
IE-only error related to custom animation
There is a plugin I am developing for a menu that stretches to match the height of the parent node. During the animation call, in IE7, I get the following error: "Line: 5899 [of jQuery.js]; Error: Invalid argument." The plugin works as intended in Firefox and Chrome. http://nathanbaker.awardspace.biz/ What gives?
auto-complete plug-in patch for custom callback to auto-populate form based on selected results
In regards to the 'autocomplete' plugin available from Jörn Zaefferer. I needed some added functionality to query a server after a user selected an item from your autopopulate list to then populate an existing form. Here is my solution... Added functionality of a callBack option Add the following three lines on or near line 235 $input.trigger("result", [selected.data, selected.value]); +if(options.callBack){ + options.callBack(selected.value); +}Now just add your callBack option with your custom
best way to set an intervalid so I can access later
I have an interval being set in my plugin. when I want to destroy the plugin I will need to be able to clear the interval. What would be the best way to access the id? function($) { $.fn.myPlugin = function(options) { if (options == 'destroy') { // Want to destroy the interval timer here. // But how can I access it? return; } return this.each(function() { timer = setInterval(function() { foo();}, 1000); });
(Basics) How to access things from another function?
Hey Guys, i want to create a Plugin: If you call it like this: $('#box').myPlugin({color: '#12345', size: 4});the Plugin have to append a new div with a text: (function($){ $.fn.myPlugin = function(options) { var defaults = { color: '#ff0000', size: 3 }; var options = $.extend(defaults, options); return this.each(function() { $(this).after('<div><p
Access a plugin methods outside plugin
I am making plugin of some sorts, so i write: $.fn.ajajforms=function(options) { var settings=jQuery.extend({ ... },options); var objs=[]; this.each(function() { objs[objs.length]=$.ajajforms(this,settings);} ) return objs; } $.ajajforms=function(div,settings) { $("#debug").append("ajajforms constructor()\n"); $div=$(div); var g={ settings: settings, add_clicked: function() {...}, some more code.... }; return g; ... } $("#test").ajajforms(); So, it works. But i sometimes need to call an add_clicked();
Need help with append()
Hello everyone. Plug-in noob here with what is probably a simple question. I have a lightbox type plugin that I'm trying to make, but I'm getting stuck when trying to insert things into the dom. Here is the code: jQuery.fn.overlay = function() { $(this).click(function() { $('body').append('<div id="overlay"></div>'); $('#overlay').fadeIn(); }); }; This kinda does what it is supposed to. It just draws a semi transparent div on the screen. The problem I am having is accessing
Obtain image dimensions while image is hidden?
I'm working on something that requires the obtain and image's dimensions and uses them for calculations. However, while the plug-in is doing certain things, I have all of these images hidden (they become rearranged in a carousel). It seems that I cannot get the dimensions of the image if it's display (well, it's parent div is actually the one hidden) is set to "none" in the CSS file. Anyone have any ideas how I can do this? Right now I have the opacity set to a really low amount, but you can still
define fields used on source of JSON retrive data ('value' and 'label')
my JSON data is not at format defined on autocomplete plugin, my fields are not called "label" and "value" in my case i use "name" and "id" for that. to use the plug-in i propose a modify on options, like: $('#project').autocomplete({ source: "search.php", label:'id', value:'name',to make that works i have make one fork (that fork steel works like original) to accept this two new options (value and label). here is a link to the script source: jquery.ui.autocomplete.custom.1.8.js i dont
[autocomplete] adding element to end of autocomplete list
I am using the autocomplete plugin on my website and I wanted to add an element to the end of the of the <div/> that contains the autocomplete list, but only if the list is at it's maximum. Basically, I just wanted to let the user know that they can refine their search to get more results. I have attached a patch of jquery.autocomplete.js where I added my changes. It's probably only a total of about 10 or 15 lines. The diff is from a svn repository, so I'm not 100% confident that it will apply
jQuery UI simplePager updated to support 1.8
Updates have recently been made to the simplePager in order to support 1.8 revision. Any thoughts/suggestions are greatly appreciated: http://plugins.jquery.com/project/ThemeReadySimplePager
Looking for a jQuery Developer for with Flowplayer exerience ASAP for 2-3 day job
Hi, We are currently looking for a jquery developer, experienced specifically with flowplayer, to integrate a video player into our web application prototype. The player interface is being built in html and has to be wired to the flash player using the flowplayer jquery library. We also hope to be able to overlay some html elements on top of the video. A few extra jquery tools (scrollable and overlay) should be integrated with our page design as well. We are under a tight deadline and need to start
Jquery calendar and tab sliding div clash…
Hey all, i am trying my best to figure out another way around this problem i seem to have encountered. On my website i have a jquery calendar and also a jquery div tab slider (this: http://www.queness.com/resources/html/tabmenu/jquery-tabbed-menu-queness.html). The problem comes into play with the DIV tag. The calender loads up inside a DIV with a id of 'calender'. The CSS for the tabs have the DIV hidden: CSS: And because of that, the calender never shows on the page. However, if i comment out that
Please add jQuery 1.4 to the 'Verified API Compatibility' option
Hello, jQuery 1.4x is out for month, but we don´t have the option to release Plugins, wich are only testet / only working with jQuery 1.4x. So please add jQuery 1.4 as an Option for the "Verified API Compatibility" dialog for releasing new plugins. regards alex
Need help on some basic functionalities
Hello all I am building a plugin that is to be a small applet so to say - its not a function as such that you can apply many times to a selector - basically it will just be appended to the body. My first question is about how I create a function inside the plugin that can become chainable? So far the applet is made up of a container with a header and body - the body holds a accordion and the accordion holds widgets (its not programmed like this right now, thats how I want it to be - at the moment
Problem with variable and function in .each
(function($) { $.fn.pluginname = function(settings) { return this.each(function() { var width = parseInt( $(this).css('width') ); $(this).bind('mouseleave', function() { gofunc(); }); gofunc = function() { alert(width); // How do I get the variable "width"? } }); }; })(jQuery);Hi, i'm new to jQuery and... oh... sorry for my english. I'm trying to get the variable "width" of ".each",
Sorting dates with tablesorter plugin
Hi folks, this one is driving me mad! I have a table of data that I was hoping to sort using the tablesorter plugin but I'm finding that it doesn't work at all on date columns. I wonder if it's because I'm working with UK dates... here's my call to the plugin: <script type="text/javascript"> $(document).ready(function() { //Attach the LoadUsers template event to the link/button $("#UsersTable").tablesorter({ dateFormat: 'dd/mm/yyyy',
works as expected in 1.4.1 but not with 1.4.2
I will admit upfront that I am relatively new at writing plugins. The plugin below was working fine in 1.4.1 but does not work fine in 1.4.2. The plugin binds a click function to specific buttons. In 1.4.1 when any of the bound buttons was clicked it fired once, now in 1.4.2 I get the same number if "firings" as I have buttons bound. Can somebody guide me as to what I need to rewrite in order to get back to how it worked in 1.4.1? Thanks in advance... Randy jQuery.fn.HSAModalForm = function(params)
Tablesorter - bug when first row has colspan
jquery - jquery-1.4.2.min.js tablesorter - 2.0.3 How to reproduce. Using the following table, clicking on the "works" header works fine, clicking on the "causes error" header causes an "parsers[i] is undefined" error <table id="myTable"> <thead> <tr> <th>works</th> <th>causes error</th> </tr> </thead> <tbody> <tr> <td colspan="2">a</td> </tr> <tr> <td>aaa</td> <td>bbb</td> </tr> </tbody> </table> As shown below, when the colspan row is not the first row in the table, things seem
Validation Reset element
Hi How can i reset a specific Element after the validation failed to the original state. $("#form").get(1).reset(); only resets the value but , not the error message. Thanks Torsten
Multimedia Portfolio 2.0.0-beta
Hi I have download the mulitmedia portofolil 2.0 beta,its a great work i would like to know that when i click on image it opens in pop up, but for the video it's shown in the same window, can i make the video also open in pop up can any one help me. Pleas can any one help me... Thank you
Access "this" in a "namespace"-function
Hi, i want to write a function that looks like this: $(elem).pluginName.disable(); and disable() should access "$(elem)" to trigger an Event. How can i achieve this? Thank your for your answers and sorry for my bad english.
What a joke!
Yes forum activity is a joke and broken. jQuery gotta be the most popular javascript framework out there, and yet this forum is all crickets. Posted 2 questions now, been running for almost a week - not one reply!
What shoul I do if I upgraded a plugin but cannot manage to join it's author?
Hello! I've recently worked on the json suggest plugin and enhanced the ajax functionality on it a lot. The author website is http://www.tomcoote.co.uk/jQueryJSONSuggestBox.aspx. The last update seem to be in 2008. I sent him an email to notify him about the changes but I didn't get any response. I think my improvements are great and want to share them with the community. What should I do? Recreate it as a new plugin? I don't want it to look like I stole the code. Thanks for your assistance Frank-Mich
How to add member function to a plugin?
I have developed my own selectable plugin. works fine. I want to do something like jQueryUI sortable, But don't know how. for example, after making some element sortable, you can call a serialize function to serialize them. $("selector").sortable("serialize"); I want to develop that kind of member functions to my plugin too. 1. $("selector").selectable("functionName"); 2. $("selector").functionName(); //this is even better I can't find the syntax or example on how to develop this feature. Please
Plugin sub functions
Hi, I'm trying to get a simple plugin for jquery going, my desired end result is this: $('#mydiv').counter({options...}); $('#mydiv').counter.add(1); $('#newdiv').counter(); $('#mydiv').counter.add(1); $('#newdiv').counter.remove(1); Can jQuery do this? If not is there a way that is just as good? I've tried a few methods, including using bind/trigger events but the ids conflicted...
Finite State Machine plugin to make testing AJAX simpler
I'm working on a Rails site using jQuery, and after reading this great post discussing the similarities between the Given/When/Then integration testing pattern and finite state machines, I've decided to try implementing all my AJAX as a FSM. The benefits of treating AJAX as an FSM is that if you can define all the possible states (S) and the transitions between them (T), then you can also describe all the expected outcomes with S * T tests. This seems like a really powerful observation; it not only
Why does passing in options slow down my code so much?
I'm working on the fasterTrim plug-in and I'm wondering why passing in custom options slows it down so much. Here's a comparison of running the function as many times as possible in 1000ms to show what I mean: $.fasterTrim.trim( " lorem ipsum " )vs: $.fasterTrim.trim( " lorem ipsum ", {} ) * Firefox 3.6: 170,232 vs 46,147 * IE 8: 69,371 vs 25,226 * Chrome 4.1: 837,572 vs 56,073 * Safari 4.0.4: 172,995 vs 82,950 * Opera 10.10: 67,934 vs 32,938 Does the code to process the
Announcing Django Ray
Not so long ago I launched a project called Django Ray and last night I posted on my blog a new screenshot of what I wanted to achieve (the screenshot also attached to this post).. The reason why I'm posting in this forum is to attrack potential developpers who would like to participate in this project. This project use jQuery, jQuery UI, Themeroller, and many jQuery plugins and at least one non-jQuery plugin (CodeMirror). One of the main challange I've encoutered so far is making all those plugin
JQGrid Error
Hi ALL, I’m using jqGrid in ASP.NET. jqGrid is literally good. As of now, I’m using Handler(ashx) through WebService(asmx) to convert the DataTable into JSON and display in the Grid. I m Unable to Populate the data to jqgrid. I m getting the data from database to generichandlers page. But That data is not bind to grid .I m getting the Following Error on Jqgrid. I m unable to Solve it. The Error is look like this Line:11 Char:1468 Error: Expected ']' Code '0' Pls Help me .. How to solve this error.
floatobject-1.4 breaks with jquery-ui-1.8rc3
My first attempt at upgrading to 1.4.2 and ui 1.8rc3 was on a page with floatobject-1.4. Floatobject barfs here: 17 var offset = this.jqObj.offset(); 18 this.currentX = offset.left; 19 this.currentY = offset.top; complaining offset is NULL on line 18 If you hard code this.Current[XY] to zero, it no longer barfs. Not saying this is a work around or fix, only a clue as to what's gone wrong. I still haven't gotten the UI stuff to work under 1.4.2 & 1.8, once I do I'll poke around
Treview plugin, relative units vs. IE
I like Treeview for simple trees. It is highly expandable. However, put the tree inside any layout with relative padding or margin and IE bails out (as usual). I tried to modify the style for relative positioning instead of float and negative margin for hitarea but still no success. Would anyone know how to fix the style while keeping the plugin struct and functionality? Here is some sample doc with dynamic tree for illustration and original /custom version testcase.
What license should I use for my plugins?
I have absolutely no idea about licencing for projects... I know that jQuery itself it protected using GPL and MIT. Could someone inform me as to what is usually used for plugin development? Or maybe some online resources that would explain it? Thank you
I must have been cheating...issue with 1.4.1
I built a number of plugins which used: var id=$.data([dom element]); to generate a unique ID for a particular dom object. This apparently was not kosher since it no longer works in 1.4.1 (returns null). QUESTION: Is there a way to get a similiar result in 1.4.1? I know i could do some kind of counter advance and then assign the element an id using .data(key,var), but the method above was very simple and quite convenient. thx, jeremy
Cycle Plugin: Active State on Pause & Resume
I'm successfully using the jQuery Cycle plugin with pager, pause, and resume functionality. The class 'activeSlide' is automatically applied to the pager links, but there is no active class applied to the pause or resume links. I'd like to add an active state to the pause & resume buttons to indicate if the slideshow is paused or playing. Any ideas?
How to target individual elements within one plugin?
I'm working on a plugin to manipulate form fields. Most plugins I've seen are implemented like this: $('#element').myPlugin({ option1: value, option2: value, option3: value }); But in the case of form fields, I think a more efficient structure would be something similar to the bassistance validation plugin: $("#form").myPlugin({ fields: { "formfield1": { option1: value, option2: value,
How can i extend jquery to include :focus
Is it possible to extend jquery to include a function that will select elements with focus In the same way :input:selected etc works but instead :focus Id like this functionality to return an inputs parent attr id Any ideas?
Next Page