create function and methods within it
I'm trying to create a function and methods within it. What I want to do is to develop a form validation plugin. I want to accomplish the following: if ( $("#field_id").validate.isFullName() ) { alert("is full name"); } else { alert("is not full name"); } what I've come up with is this: $.fn.validate = { isFullName: function() { if ( $(this).val.match(/^[a-z]+$/i) ) { return true; } else { return false; } } } but it doesn't work. Does anybody know how I can
[jQuery] Do something, ONLY if parent has children
I am wondering how I could check if a parent element has children, and it it does not, I would like to hide the parent. I was looking at something like the following, but I am not sure how to get it to work how I want: $("#main > *").hide;
The idea of functions in jQuery and what am I doing wrong?
Hi there! I wrote a small script: $(function() { function klappmenu(id_name) { id_status=id_name+"_status"; head=id_name+"_head"; var id_status = $.cookie("+id_status+"); if (id_status == null){ $("h3#"+head).addClass('zu'); $("#"+id_name).css("display","none"); }; if (id_status == "zu"){ $("h3#"+head).removeClass('auf'); $("h3#"+head).addClass('zu'); $("#"+id_name).css("display","none"); }; if (id_status == "auf"){ $("h3#"+head).addClass('auf'); }; $("h3#"+head).click(function()
[jQuery] Stop $.ajax() from clearing the page
Hi :-) My script: http://pastebin.com/m2b0341e5 I have this form, when I submit it, the php script runs and returns some JSON. The problem is that I want to display the errors on the page with the form, without it clearing any fields, however, whenever the handleResponse function is done it clears the #loaded div completely - the form disappears and the values are lost. How can I avoid this?
[jQuery] mouse hover focus not working in FF2
I'm using the jquery mousewheel plugin, which is working fine on IE 6 and firefox 3, but not firefox 2. firebug shows no javascript errors. my code is supposed to switch focus between two elements as the mouse hovers over them (one contains a flash widget): $(function() { $('#widget') .mousewheel(function(event, delta) { event.preventDefault();//still propagates though }) .hover(function() { $('#widget').select(); $ ('#widget').focus(); }, function() { $('#mainWrapper').select();
[jQuery] need help superfish jquery for Joel Birch
Hi ! Need help for parameter timed delay on mouseOver not mouse out We want small delay before menu drop down 1 second for example our test : http://infoclick.ca/newweb/ Our Goal http://www.target.com/ if you put your mouse from left to right (women to Sell All) menu doesn't open put if you wait 2 second on Women or Kids , menu drop down Thank'S
[jQuery] ASP.NET UpdatePanel vs. jQuery - Tutorials
Hi all, I'm looking for some kind of tutorial for the topic in the title... Thank you
[jQuery] jEditable Used Many Times on a Page
So far I have really loved using jEditable for my website. So much so that I am(attempting) to use it to replace the normal form interface for a CakePHP site. What I'm trying to do is just show the user the normal webpage but if they want to edit anything they just click it (jEditable). The rub is that I will be using this a lot on any given page. I am having trouble trying to figure out how to code all the info jEditable needs into each html item (<div><td> etc etc) that needs to be jEditable. I've
[jQuery] News ticker with categories
Hi, I'm a php developer and new to jquery. I've been pulling my hair for a good day in creating a news ticker with categories. There are two boxes, one scrolls up categories, and the other showing headlines in the categories. Sth similar to the ticker found here (it's a java applet though) http://appletlib.tripod.com/headline.html . The categories & headlines should freeze on mouse over, and user can click the up & down arrows to manually scroll thru categories. This image is the expected result:
News ticker with categories
Hi, I'm a php developer and new to jquery. I've been pulling my hair for a good day in creating a news ticker with categories. There are two boxes, one scrolls up categories, and the other showing headlines in the categories. Sth similar to the ticker found here (it's a java applet though) http://appletlib.tripod.com/headline.html . The categories & headlines should freeze on mouse over, and user can click the up & down arrows to manually scroll thru categories. So far this is the code I come up
[jQuery] Symantic Markup with Nice Accordion.. ..
I had the original demo from a popular site to get the Accordion menu to work... I work with a team and we have designers who will want to access the markup with css perfectly. So of course we want the markup like this: <div class="demo-show2"> <ul> <li style="border-top: 1px solid black;" class="menuCat">Category One<ul class="linkContainer"> <li><a href="/products/c1_products/c1_sub1_products">sub-Category c1_sub1</a></li> </ul> </li> <li class="menuCat">Category Two<ul class="linkContainer" style="display:
[jQuery] jCarousel question
Jan: I am using jCarousel within a jqModal box (http://dev.iceburg.net/ jquery/jqModal/). The problem is that sometimes the jCarousel style sheet does not seem to operate. In short, sometimes the elements in the carousel to do display horizontally but display as a list. Occasionally, the carousel will display as a list and then pop into horizontal display. In the style sheet, I removed all references to vertical styles. The misbehavior is the same in IE 6 and FF 2 and 3. Site: www.satterlee.com/bec
[jQuery] OT: Bug in IE: Flash, iframes, and dynamic height of Flash movie
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=us-ascii"> <META content="MSHTML 6.00.6000.16640" name=GENERATOR></HEAD> <BODY> <DIV><SPAN class=493405915-30052008><FONT face=Arial size=2>We have a Flash movie that resizes vertically based on it's content. When it resizes itself, it also issues a command to the containing page to resize the HTML container. This works great under regular use. But lately some of our
[jQuery] removeAttr for rowspan
Since upgrading to 1.2.5 (the same applies to 1.2.6), an attempt to $ ('... td').removeAttr('rowSpan') triggers an error in IE6/7. Previously (up to 1.2.4b) it effectively set rowSpan to 1. It still works that way in FF. I'm not sure is it a bug or a feature, but of course it has broken my application, so... I guess it should be either fixed or explicitly noted in the docs. I wonder, will it cause the same problem for some other attributes?
[jQuery] Hover Effects
I was browsing the <a href="http://dragoninteractive.com">Dragon Interactive</a> website. When you hover over certain buttons, they produce a gradient effect where the sprite image slowly appears. How can I achieve this effect? Thanks, Mason
[jQuery] $(document).ready Events not firing on elements of code injected via ajax call
Im using $(document).ready to bind an onsubmit and onclick event to 2 elements of my form. Either of these events fires separately with no problem. However, when the onsubmit injects html into a div on page, and I then attempt to click on one of the newly injected elements expecting the onclick to fire, it doesnt. Is there something about the dom not being refreshed or $(document).ready not able to bind elements after the page has been loaded and new html injected? Can I update the dom? is there
[jQuery] checkbox manipulation and toggle()
Hello... short version: how do I exclude an element in my selector expression? long version: you know those checkboxes in windows where you can actuyally click the label to check the box? I'm recreating this with a toggle() like this: <DIV id="CheckContainer"><INPUT type="checkbox" id="Check"/> Click here</div> $("#CheckContainer").toggle( function(){ $('#Check')[0].checked=true;}, function(){ $('#Check')[0].checked=false;} ); All fine and dandy as you click the DIV
[jQuery] REMINDER: jQuery Site Detection Greasemonkey Script
Hi everyone. The number of jQuery-powered sites being listed is incredible and the numbers just continue to grow. One of the methods that I use to find sites is via jQuery Team Member Paul Bakaus' awesome jQuery Site Detection Greasemonkey Script. It's a small script that detects the jQuery object and displays a small icon in the lower-right corner of the browser if it finds a jQuery-powered site. To install it, just follow these simple instructions: This is a Greasemonkey user script. To install
Custom JQuery dialog box
Hello! I'm a web developer and in this period I'm using a lot JS. I've created a custom JQuery object dialog and I want your oppinion about it.... I'm using IFRAME because on IE6 I've SELECT overlay bug Thanks! (function($) { $.extend({ VlDialog: new function() { function closeVlDialog(oDialog, oSeparator){ $(oDialog).remove(); $(oSeparator).remove(); delete oDialog; delete oSeparator; } this.destroy = function(){
[jQuery] Why report "handler.apply is not a function"
in html: <script type="text/javascript" src="/new/js/jquery-1.2.6.min.js"></ script> <script type="text/javascript" src="/new/js/cms.js"></script> <a class="Brand" href="#"><img src="check.gif"/></a> in cms.js: checkDeleteBrand = function(){ window.confirm("Really want to check this brand?"); } readyFunction = function(){ $('a.Brand').mouseover("checkBrand"); $(document).ready(readyFunction); When I move my mouse on the check.gif, it will report a error message: "handler.apply is not a function "
[jQuery] Making a hrefs and using click on them
Hi, I am a newby to jquery, and am strugeling with an issue. In my code below, I get information from an php page which is returning xml. I am making links in a <ol><li> of what the php page return. But I want to catch the call from the a href I make when the user clicks on the link. How can I do this? This is my code: $(document).ready(function() { var box1 = null; var box2 = null; var box3 = null; // add markup to container and apply click handlers to anchors $("#fabricatorSearchName
[jQuery] tablesorter / tablesorterPager question
I posted this in the plugins group, but just noticed it is dead there. I have a tablesorter.tablesorterPager table in which I need to remove rows and have the pager updated accordingly (trying to avoid an ajax refresh on the table). Right now I'm removing the target row through jquery remove() function. After which I'm triggering 'update' and 'applyWidgets' events (I have some custom widgets for other things). My issue is that I cannot figure out how to update the pager. If I call a redraw on tablesorter,
autoscale
Hi I'm using autoscale.js on a page with some animation effects. I'm just wondering if this code is written in the most efficient way, i.e I'm unsure how to group autoscale function with the animate functions. the background fades in but needs to resize first. Here's the code: <script type="text/javascript"> $(document).ready(function(){ $(".bg").animate({opacity:'show'},1500,function(){ $("#header").animate({opacity:'show'},1000,function(){ $("#mid").animate({opacity:'show'},1000,function(){ $("#footer").animate({opacity:'show'},1000,scroller.init());
[jQuery] Get co-ordinates of click on image
Hi all, Working on something for a client at the moment - they have a map and they want to pinpoint where on this map something is, and then store this in the database. I'm thinking we put an image of the map in the admin area for them and they can click on it to set the co-ords, but I'm not sure how we'd fetch the co-ords of where they clicked? Just as X,Y pixels from the top left of the image, nowt too clever. $("#map").click(function() { // WHAT GOES IN HERE? } Does anyone have any thoughts? All
[jQuery] [validate] error messages for bilingual site
Hello, First thank you for this great plugins. How can I generate error messages in the user chosen language (French or English)? Alternatively can how could I send a PHP constant as error message? Thanks Philippe
[jQuery] trouble passing href
Hi all, new to JQ. I'm trying to pass the href from the <a> tag to the ajax load function. I believe i've selected the child properly but for some reason it's not pulling in the href. Any help is greatly appreciated! site: new-age-design.com code: <?php include('includes/header.php'); ?> <div id="header"> <div class="container"> <h1><a href="index.php">Site In Development</a></h1> <ul> <li><a href="#" style="color:#000;">Link</a></li> <li><a href="#">Link</a></li> <li><a href="#">Link</a></li>
[jQuery] How to make the pause 3 sec or some delay
That all :) How to make the pause 3 sec or some delay :))
[jQuery] [validate] bug
There needs to be a check for value !== null in the attributeRules method of the jquery.validate plugin. It bombs otherwise when collecting the rules . Not sure if this is because of using the 1.2.5 jq release. Also I have a patch here http://plugins.jquery.com/node/1667 that is three months old...do I need to submit this somewhere else to be considered? This patch lets forms get submitted via Form plugin when onsubmit='false' Thanks in advance! Mike
[jQuery] Handle sortable items without using the mouse.
I would like to know if there is a way to move sortable items without using the mouse. I have a few sortable items and the user have the opportunity to "hide" a specific item (Change opacity to 0.3). At the same time I want the item to be the last one in the dom-structure of the sortable items. What is the most simple way to move an item in the dom-structure. And will my Update Function react on the action? Feel free to write your suggestions and opinions. Thanks in advance
[jQuery] How to use jCarousel in Drupal 5.7
Hi, I had downloaded the jquery_update and jcarousel module form drupal.org and installed these. Now the problem is how i can configure this in front end.i.e. how i can show jCarousel in front end. What code snippete needs to write me?
[jQuery] What is the purpose of th jcarousel this.funcResize() function?
Hi, I've been playing around with the jcarousel plugin for jquery and it works really great. However I am getting annoyed by the fact that every time I open up firebug or resize the window fo my browser, jcarousel automatically forces the prev() function to be executed. I had a look at the code and it appears that this is caused by the "this.funcResize" property. Does someone know the purpose of this? Is it just an undocumented feature? If so, what is the logic of forcing the carousle to move to
[jQuery] "Highlight" plugin updated (highlight elements and related elements as you interact with them)
Hi Everyone, I've recently updated my "Highlight" plugin, which is designed to increases usability by highlighting elements as you interact with the page. Its primary use is for forms, but it can also be used for tables, lists, or any element you specify. Examples uses: * Form-filling can be made clearer by highlighting the element around a control as you tab into it * Table rows can be made more visible as you pass the mouse over them, or click them * Elements can be toggled on and off as you click
[jQuery] bug: [ui 1.5b4] jquery ui ... dialog problem
I used jquery 1.5b2 packed and I use jquery dialog ... it work perfectly .. but when I used 1.5b4 packed ... the dialog won't open ... it produce error ... which i don't know why ...
[jQuery] element.attr() bug in jquery 1.2.6?
Hi all, I've run into a strange issue that I believe is a bug in jQuery 1.2.6. I've posted a ticket along with a test HTML file at: http://dev.jquery.com/ticket/2959 As far as I can tell, attr() is not properly updating the value of a form attribute, although prior versions had worked fine. Any help in resolving this, or providing a workaround would be greatly appreciated. Thanks in advance, -phil
[jQuery] corners plugin works in IE but fails in Firefox
Can somebody help with why this example works in IE 7 but fails to show corners in Firefox 2 ? http://paste.pocoo.org/show/55276/
[jQuery] jBox plugin help needed
I am using this plugin http://www.aspstat.com/jbox/demo.htm owner has apparently died. and I need help knowing how to programmatically close the iFrame window. window.close and jBox.dispose( $('#jBox1') ); don't work thanks in advance
[jQuery] jQuery site broken in IE6
I tried to visit the jQuery site today in IE6 and found that most of the site does not display correctly. I could not find a way to view the docs. Is this a known problem with the site? Doesn't look good for a library that supports a browser to have a website that doesn't work in that browser.
[jQuery] jQuery Form Plugin target confusion
I'm using the jQuery form plugin and specifying my target as so: $(function() { var _options = { target: $( this ), beforeSubmit: function(data, set, options) { alert( $(set).attr( 'action' ) ); } } $( '.form' ).ajaxForm( _options ); }); I've also tried using just the 'this' keyword. Anyway, when I use this it freezes the browser... My goal is to make the response target wrapper the same form that I'm submitting (basically a refresh of the newly updated form). I can't just leave the form as is due
simple jquery question
hi , IF i have $(document).ready(function(){....} on my page and then i by using ajax i load another page inside DIV element of first page and that page already has its own function $(document).ready(function(){...} will it cause any conflict on the page and will work or not
[jQuery] Convert special characters
I have a form, which sends text through .ajax(); using POST. But for some reason, it is making special characters into strange text. For example, when quotes are posted, ’ is received on the other end instead. Should I be using a special jquery function to convert special characters? As it seems when using a normal form post this is not a problem.
Next Page