Adjust the Scroll Position of an IFrame
Does anyone have an example of how to automatically scroll the page inside an IFrame? I have an IFrame that has no scroll bars, but there's a bit of whitespace that I want to get rid of. Unfortunately, the page in question doesn't have an element in the right area with an ID that I can anchor to. Here is code I was toying with: jQuery(document).ready(function () { jQuery('iframe').contentWindow.scrollTo(20,20); });
live('load',...) doesn't work on images added dynamically to DOM
Hi, I want to be able to execute some callback when images are being added to the DOM dynamically. It's worth mentioning that the images are being brought into the DOM with ajax calls on a third party widget, so I can't hook up to any events of the ajax request/response, nor can I trigger an event on append() and such, because I'm not the one calling those. I tried using $('img').live('load',function(){...}) for this, but it seems live doesn't catch the load event (other events, like mouse events,
if radio button checked display div #something else display nothing if un checked
if radio button checked display div #something else display nothing if un checked currently I have this and it works but when I click another radio option the div that was activated before stays there. Want a div to show only if certain radio button is checked and if not checked to hide. $(function(){ $('#offer_2').click(function(){ $('#total2').show(); });
How do I slide left using the changePage function?
Hi everybody, I have searched and tried to find a way to get the transition to slide left when I use the changePage function. What I'm doing is using the swipe function to change page. My code looks like this: $(".map").bind("swipeleft", function(){ var id = $.mobile.activePage.attr("id"); var newPage = parseInt(id); newPage++; $.mobile.changePage("#"+newPage, "slide"); }); $(".map").bind("swiperight", function(){ var id = $.mobile.activePage.attr("id"); var newPage = parseInt(id); newPage--;
sliderfader that cycles all images in folder?
Trying to adapt a simple slider/fader so that is cycles through all images in a folder. Using this... <script type="text/javascript"> $(function() { var imgs = [ '../images/1.jpg', '../images/2.jpg', '../images/3.jpg', '../images/4.jpg']; var cnt = imgs.length; var $imageSlide = $('img[id$=imageSlide]'); // set the image control to the last image $imageSlide.attr('src', imgs[cnt-1]); setInterval(Slider, 3000); function Slider() { $imageSlide.fadeOut("slow", function() { $(this).attr('src', imgs[(imgs.length++)
anyone know of a draggable image carousel?
cant seem to find anything like that. would a plugin like dragscrollable do the trick?
Browser scrollbar with added easing - Any ideas?
Hello folks. I was wondering how is this easing added to the browser scrollbar. http://www.moodsofnorway.com/#/home This something that I would like to implement on my website. Is this an adapted scrollTo script? I imagine a function storing a current Y & new Y position on the fly as against a fixed value scrollTo. In my search I had a play with the jquery drag and drop, but I could only implement this effect with a div and not with the scroller. Actually writing the script is beyond me at the moment,
.load() headaches
I have this block of code for a context menu: This menu item works perfectly: else if (action == 'folder') { $.post("php/createfolder.php", { folder: el[0].className }, function(data) { $(el[0].parentNode.parentNode).load("php/loadsection.php", { idClass: el[0].className }, function(data) { createMenu(); makeEditable(); } ); } ); } another part of the code never runs the createmenu or makeEditable functions unless I throw an alert! Can anyone help figure
Select change > remove an item from the select field
What I try to do is the following..let's say I have this form: <select name="sSelectMe" class="someclass"> <option value="">select an option</option> <option value="1">option 1</option> <option value="2">option 2</option> </select> How can I remove the first option from the list when someone selects any item?
jQuery + PHP
Hi Everyone, Is it possible to change a table cell background color or add any attributes based on a criteria, anyway, here's my scenario... I have a php table dynamically created onthefly, (let say on load), then i have a sql query returning some values so illustrating; Table: Sql Result 1 2 3 4 5 2 5 7 6 7 8 9 10 What im trying to achieve is use the sql result to add attributes to the table cells so for the illustration say i want to add a bold attribute
iframe onload in webkit browser
Hello there, I have prepared this jsfiddle test http://jsfiddle.net/dujdV/5/ which works in Firefox but not in Chrome. Any idea? Regards, Aamir
how to insert mysql php jQuery
im using this teturial http://yensdesign.com/2009/01/how-validate-forms-both-sides-using-php-jquery/ how to insert to mysql i make a new database for test but can't found the way how to insert the records thank you for your time
Eq Selector Question
Hello, I have a question pertaining to the "eq" selector in jQuery. I"m using something like this to apply classes to the navigation menu below. $.each($('ul.menu'), function(){ $('#' + this.id + '.expandsecond ul:eq(1)').show(); }); Which applys the class "expandfirst" to the first nested ul. Does anyone know how I can apply this to a <ul> even deeper, the third level navigation essentially? <ul id="menu" class="expandfirst"> <li>choice 1 <ul> <li>sub choice 1</li> <li>sub choice 2 <ul> <li>third
Force divbox to move down, if other divbox expand
Hey, look at this fiddle http://jsfiddle.net/CW7uF/4/ I want that if i go e.g. on "Main 1" and the div2 expands the other "Main Tabs" slide down and you can fully see the div2 I just tried to do that with div1 ---> position: relative; but dosnt work Any idea why this dosnt work?
$.get() returns different object type in IE8 and IE9
Hi folks, Could someone confirm this please? Using the following code, from jQuery 1.5.1: $.get(xml_file).success(function(data, textStatus, jqXHR)) { alert(data); } The returned result seems to be: On IE8 data is an "[object]" On IE9 data is an "[object Document] I guess it should always either be: "[object]" or: "[object Document]", not a mixture as this breaks code. Regards, Yomodo
JQuery.ajax response html
i'm developing an application using $.ajax to display information in a div on a webpage after change event: $(document).ready(function() { $('#targa').change(function(){ $.ajax({ url:"index.php?rt=parcheggioOrdinario/parcheggia", type:"POST", data: ({targa:$('#targa').val(), datatime:$('#datatime').val()}), success: function(response){ $('#movimentiParcheggio').html(response); } });
Weird problem in Safari
I was having a problem with some code not working after refresh, but now (with different code) I'm having a problem where the jquery doesn't work on the first load and works after I refresh it any amount of times. Sounds like when the page is cached everything works. With a google search, all I could really turn up is that the jquery needs to be wrapped in the following: $(document).ready(function(){ // your code }); I've done this and it's still not fixing my problem. It's weird, because
Jquery Extraparam as textbox value
$().ready(function() { $("#txtpro_no").autocomplete("getplotno.php", { width: 260, matchContains: true, mustMatch: false, // This I want to pass value of textbox dynamically which is not working extraParams: {id: $("#txtproj_id").value}, // I Tried This Also which is not working //extraParams:{id: function Getval()}, // This Works but no dynamic value
how to : File Chooser after file is selected nor CANCEL
Hello...!! I haven't got any idea, how to put the jquery once file is selected, and not Cancel is selected. Let's assume we have <input name="title" type="text" value="- none -" size="33" maxlength="50"> <input name="filepath" type="file" size="33"> and at another portion of that page also have a similar repeated code as above. I want to put some changes once the File is selected not when the button Browse is Pressed. Is there any work around?
First ajax sample, I need advice.
Hi guys This is my first ajax test sample. Okay here is the codes of sample1.htm <!DOCTYPE html> <html> <head> <style> div { font-size:14px; } </style> <script src="http://code.jquery.com/jquery-1.5.js"></script> </head> <body> <div ></div> <script> $.ajax({ type: "GET", url: "test.js", dataType: "script" }); </script> </body> </html> Below is the codes for test.js document.write("This is from external file, test.js") I tried to run this but it did not show anything, the page
making sure element/selector is an select <option>
hey guys i have a select box that looks like this for exaple: <select id="game"> <option id="mario">Mario</option> <option id="SuperMario">Super Mario</option> <option id="MarioKart">Mario Kart</option> </select>and what i want to do is when selecting #SuperMario i want to find out if its and option like when checking #game is a select box but how to check if select/element is actually an option if (#game.att(''type) == 'select-one') { // code }if anyone could help me with the right code on how
jquery Highlight func.
Hi this jquery Highlight func. I am sending data to function in this way return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>"); this send data or value= "Computer<br><span style='font-size: 76%;'>Computer Software</span> this "Computer" not Highlight this Highlight "Computer Software" help me...
this function works in firefox but not in IE8 ? traversing through DOM
the below functions work in firefox but not IE8 any idea why? it throws the slow script with no end... $.fn.reverse = function () { return this.pushStack(this.get().reverse(), arguments); }; // create two new functions: prevALL and nextALL. $.each(['prev', 'next'], function (unusedIndex, name) { $.fn[name + 'ALL'] = function (matchExpr) { // get all the elements in the body, including the body. var $all = $('body').find('*').andSelf(); // slice the $all object according to
offsetParent not returning relative positioned ancestor
In my jQuery plugin, I'm trying to position an element absolutely within the target element's "offset parent." According to the jQuery documentation, offsetParent is supposed to return the nearest ancestor that is positioned, meaning absolute, fixed, or relative. However, when calling that function, I'm not getting the expected ancestor. The target element is located in a position: relative parent, and offsetParent is returning something further up the tree. Is the documentation wrong? Are there
Animate using CSS3 instead of JavaScript
I'm converting a jQuery-based web application for use on mobile and need to make use of the hardware-accelerated performance of CSS3 animations. Ideally I'd like a plugin which overrides some of the basic animation (i.e. fade) functions to make use of CSS3. I've searched around but can't find anyone that has tackled this problem, so I'm considering writing a plugin myself. Any pointers appreciated. Thanks N
Accessing $(this).data('link') in ajax success function inside modal form
Hi there, How do I get the value of $(this).data('link').id into the success part of my ajax call in a modal form (when validations have been satisfied)? I can retrieve it ok in the form function but I guess the ajax success function can't see it? $('.extern').click(function(event) { event.preventDefault(); $( "#dialog-form" ) .data('link', this) .dialog( "open" ); }); }); success: function(msg){ // do something like this, var test = $(this).data('link').id;
JQuery Lightbox works only SOMETIMES?
Hey I finished my Hompage and loaded it up on the Internet. I used some JQuery to show divs or hide them. I also used the JQery Lightbox for my Pictures and sometimes it works but not always. You can see the problem on my Homepage: My Homepage The Picture Gallery is under the link "Fotos" and then klick on (for example): "Frankreich" or "USA". If you click on the Picture, the lighbox should start but sometimes it just opens a new window and shows the picture. Maybe somebody can help me? Thank you
'input:text' selector not finding input element with no type attribute
As recently as 1.4.3 $('input:text') would find input elements with no type attribute, but after upgrading to 1.5.1 that is no longer the case. Is this a bug or an intended refactor to be more standards compliant? FYI - this is the selector I now have to use: $('input:text, input:not([type])') Cheers, Jonathan
.ajax() Timing Considerations
I am having some 'timing issues' when using .ajax() in asynchronous mode. Basically I have two functions: retrieve_data(); work_on_data(); They are called in this order. retrieve_data() performs an .ajax() call, and the return data is used to populate a data-structure as a function passed in to the .ajax().success callback method. The obvious problem is that work_on_data() is being called before the data-structure is being populated, so nothing is built correctly and displayed on the page. A 'hack'
.hover() problem (slider)
Hi, I've created a slider But I've a last little problem. So it would be nice if someone can help me here :) 1. Download the file above named "theslider.zip" 2. Open the slider.html in any browser Follow these steps to understand my problem: 1. Hover with your mouse over "Tab 1" --> now the "divbox" expand and the "underbox" slide down At the moment it does the following: The underbox collaps if I leave the area of Tab 1. So if I hover from Tab 1 to the opened underbox the Tab collaps..............thats
Size() and Children() returning different results
Hi, I have the code: console.log($(this).parent().parent().children()); console.log($(this).parent().parent().size()); And the output is: jQuery(td.center, td.center, td.center, td.center, td.center, td, td) 1 Why is the size() 1 and not 7? I can't quite figure it out. Many thanks! Chris
Start new div on <hr/>
Problem: I have a piece of HTML-content, with <hr/> as section breaks. I want to replace the <hr/> with a new <div>. Thus, original: <div>Test test test<hr/>Test test test</div> Result: <div>Test test test </div<div>Test test test</div> With $('hr').replaceWith('</div><div>') it does not work, because the replacement is not valid HTML. I want to create columns, with <hr/> the column-divider. Perhaps there is also a better solution. The editor is creating the content and inserting HR's where a
how to multi languege
function validateEmail(){ //testing regular expression var a = $("#email").val(); var filter = /^[a-zA-Z0-9]+[a-zA-Z0-9_.-]+[a-zA-Z0-9_-]+@[a-zA-Z0-9]+[a-zA-Z0-9.-]+[a-zA-Z0-9]+.[a-z]{2,4}$/; //if it's valid email if(filter.test(a)){ email.removeClass("error"); emailInfo.text("Valid E-mail please"); emailInfo.removeClass("error"); return true; } //if it's NOT valid else{
Best way to update selectedIndex variables?
http://jsbin.com/obuko4/edit This is my sample code so far. Currently it only works for "Akali" under the "Select a champion..." dropdown list. The way it works is, you select a level from 1-10 from the "Select a level..." dropdown list, and then you select Akali from the other dropdown list and her "Health" is calculated by "lvl * 80 + 510" which works perfectly. But the problem is if you change the level that value does not update automaticly. Instead the person using it has change the level to
Simple jquery tree structure menu: Review
Hi Everyone! I have done a recent tree structure menu in jquery and i would like to know your suggestions on the same. Critical reviews are always welcomed. Do tell me how can i improve the code. Here is the link. http://mediamilan.com/how-to-create-simple-tree-structure-menu-using-jquery-and-css/
Trouble with jQuery and AVG Safe Search plugin for Firefox
Hi guys, I've some problems with rendering my own web pages using jQuery and jQueryUI (all recent versions) on Firefox (with AVG plugin installed). Googling for problem solutions I've found some blogs that advise to disable the AVG plugin. But, obviously, I can't ask my users to disable a plugin to see my website! But... surfing on jquery.com or jqueryui.com everything works fine. There isn't, in any case, any rendering problem. How can it be possible? Could someone help me, please? Matteo
UMTS-Sticks can break jQuery
It is not a problem or bug of jQuery but I wanted to share an experience I just made. A customer reported us that he can't use one specific part of a web application we provide. We could not reproduce it and for us and other thousands of customers there was no problem. So we decided to have a desktop sharing meeting. In response of my questions he said that this problem encountered two weeks ago and that he has problems with other websites too. I saw that there is a syntax error in the jQuery library.
How to select a list Item then add it to a Form Value
Hello I need some advice please. I have got a basic Unordered list of Options and I want to be able to click on one of the options and have that option added as a value to a Form Value Input on my submit form. Users will have a choice of around 200 options and I need them to just add one of them with a click to the submit form. I do not want to use a 'select' box to list the options,it has to be a visiable unordered list. Please help me. Thanks Gezzie
Having a problem with a rotator. displaying in firefox, but not Chrome or IE
I made a quote slider on a website im helping build, it works in Firefox, but not Chrome or IE, below is a link to the site, and also my code. www.GQCoatings.com <script language="javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"</script> <script language="javascript"> $(document).ready(function(){ $('#testimonials .slide'); setInterval(function(){ $('#testimonials .slide').filter(':visible').fadeOut(1000,function(){ if($(this).next('li.slide').size()){
Problems with slideUp in Chrome
Hi, after Domready some elements are added and modified to the site. After this i'm sliding up these elements with $(myParent).find('span.' + myClass).slideUp(1); // slow also doesn't work this works fine in any browser (e.g. firefox, IE, etc.)... but not in Google Chrome. if i call the object text with aller() it works fine in chrome also hide() works but not slideUp... after the element is done and i click a link that calls slideDown eg slideUp it works fine but not in the first call after
Next Page