Creating a rotator
New to javascript/jquery, been trying to create a rotator which displays a large image with caption and uses next/previous button and thumbnails for control. Everything works fine but when the rotator gets to the last item i'd like it to go back to the first, and when the previous button is clicked at the first item I'd like it to go to the last. $(document).ready(function() { //set to zero var x = 0; //rotation speed and timer var speed = 5000; var run = setInterval('rotate()',
getting "font-family" from an iframe
I've run into an issue retrieving the current font-family property of an element from within an iframe... Is this not possible? Is there a workaround one might be able to suggest? It would really really help me as I'm stuck on this one. For example, while working directly within the document, I can retrieve the current font being used successfully by the usual: <script type="text/javascript"> $(document).ready(function(){ var getFontFamily = $("#get_font_of_this").css("font-family"); alert(getFontFamily);
Appending to jQuery response
Hi I need to make a second request from within my original query and append the results. But I am not sure how to go about doing this. Here is the js code I have right now. $.fn.show = function(Id) { var ajaxOpts = { type: "POST", url: "/TestPage.aspx/Variable", data: "{VariableID: '" + Id+ "'}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(response) { var result1 = getAspNetResponse(response); // Make a second request to another aspx page and if there
Select Image dropdown with click function.
The following code produces the images in the dropdown select box, but does not process the click function. <select id="ipselect" name="ipselect" size="15" style="width:150px" > <?php echo $IP; ?> </select> <script language="javascript" type="text/javascript"> $(document).ready(function() { $("#ipselect").msDropDown(); $('#ipselect').click(function() { alert("selected!"); }); }); </script> Using the same code, I alter the $("#ipselect").msDropDown(); to a bogus ID such as
Two set of tabs
Hi guys, how to put two set of tabs on the page that are using the same pieace of javascript code? regards, Bas
find vs filter
HTML markup <div id='container'> <p> this is p <a class='clickme'>clickme</a> </p> </div> Here is JavaScript code. a=$('#container p'); log(a); b=$('#container').find('p'); log(b); c=$('#container').filter('p'); log(c); I get values for a and b. However c is blank. I can't figure it out. I am using jQuery 1.4.2.
Problems with $.getJSON
Can you see an ajax call in Firebug when using $.getJSON? If so, does it return the jsonobject correct? Maybe there are some enters or something in front of the json?
JCarousel and Coldfusion
Hi all, I'm still pretty new to JQuery and I could use some help in finding good documentation, tutorials, etc. for JQuery and Coldfusion integration. I've had some experience outfitting JQuery accordion menus into Coldfusion modules, but that's about it. I'm primarily looking for a push in the right direction on using a JCarousel inside a Coldfusion module that loads any number of divs containing <img>, <p> and <a> tags. The number of divs to output varies from page to page. Thanks in advance for
Using JQuery to POST to Multiple Files
I am trying to make a script that allows one form to POST to multiple PHP files. Here's what I have right now: $('#submitbutton').click(function(){ $.post('form1.php', $('#myform').serialize(), function(data, textStatus) {}); $.post('form2.php',$('#myform').serialize(), function(data, textStatus){}); window.location.href = 'thank-you.php'; }); When I click the submit button the first time, nothing happens and my data entered disappears. When I click a second time, it goes through and submits the
Using load() to get data from a parent directory
I'm trying to use the ajax load() method to load a file from a parent directory, e.g. $("#divTests").load("../tests.htm"); But that doesn't work. I can load a simple html file from the same directory as my html file or a descendant directory, but not an ancestor directory. Nor can I load from an external server. Is that just the way it is, or is their a way to accomplish what I'm trying to do? Thanks for your help.
Adding values from a radio button group
Hi to all in the forum! I'm trying to develop a module for an aplication and i'm basing on an example from the jquery ui dialog http://jqueryui.com/demos/dialog/modal-form.htmlBut i'm using radio buttons and a datepicker field but problems occur when i try to add a second row to the table. It just adds the date value but the "motivo" value don't. I mean everything works fine at the first attempt but at the next it fails. Here is part of my code: $(function() { var fecha = $("#datepicker"),
Load 2nd page to the first one
hello i want to load a 2nd page in the first one, when you click on a link when you click on the link you get also the item id. This is the function that i have so far, but i't doesn't work... function loadTranslationArea() { targetId = $('.edit-trans-link').attr("id").replace('translation-', ''); // dit haalt het id op $.ajax({ type: "POST", url: "/ajax.php?com=keywords&item=edit-translation", data: targetId, dataType: 'text',
Recreating Roll Out Menu - 1st time jQuery user
I'm using jQuery for the 1st time and trying to recreate the effect which is used on the menu on the following site: www.graphicadesign.com I have managed to get the basics working and have uploaded to a temp address which is here - at the moment i am just trying to get it working for the 'company' menu. With this being my 1st attempt with jQuery i've already run into a number of issues which i'm not sure how to go about solving! - currently, in my version, hovering over the sub menu items does not
Positioning jquery slide
I managed to make a jquery slideshow work in Wordpress but it's positioning the posts outside of the container. I can't figure out how to fix it.. http://themes.conceptsplash.com/portfolio/test-page Can someone please help?
Regular expressions in jQuery?
Is it possible to use regular expressions in jQuery? I'd like to toggle the display a block of items with similar ID's. i.e id= "Body" + someString + "Item" + 'toggleGroup' id="BodyOppsItemS1G1" id="BodyReqsItemS1G1" id="BodyProjItemS1G1" where the variable 'toggleGroup' could be S2G1, S3G1, etc. Here's what I've got that's not quite working. $("[id*="+ /\bBody\B\S*\BItem/ +toggleGroup+"]").css('display', 'block'); TIA!
how to exlude id if it is a part of a class in a selection?
Hello, i'm trying to exclude one identifier from a part of a class that i do a selection on, i cannot find how this is possible and if it is possible. my code: <ul id="nav_menu_top" class="horizontaal_menu"> <li id="nav_home"><a href="#">Home</a></li> <li id="nav_consult"><a href="#">Consulantancy</a></li> <li id="nav_services" ><a href="#">services</a></li> <li id="nav_foto" ><a href="#">fotografie</a></li> <li id="nav_overons" ><a href="#">Over ons</a></li> </ul>jquery
slideToggle Issue
Hey guys, I have a .slideToggle function on my website when any of the header top links are clicked. One div slides up and down 'over' another. In the jQuery, a #main-content-portfolio slides down, then disappears but when it slides back up it reappears AFTER the slide. Is there a way to make #main-content-portfolio appear BEFORE the slide? $(document).ready(function(){ $(".slide-button-one").click(function(){ $("#main-content-info").slideToggle(800,function(){ $("#main-content-portfolio").toggle();
Use jQuery efficiently across multiple areas - multiple select boxes affecting visible items
I'm quite new to jQuery and have this working, though I'm fairly sure if this won't be an efficient way to do this. I have a form with each day of the week, and each day has a choice in the number of slots which then shows the correct number of slots for entry for that day. The form: <table border="0" cellspacing="0" cellpadding="0" class="DataTable"><tbody> <tr> <th> Day </th> <th> Slots </th> <th> Entrys </th> </tr> <tr> <td> Monday </td> <td> <select name="frmSlots1" id="frmSlots1" title="Select
Workaround bug 5383, complete called twice in Ajax with JSONP
When JSONP is called to a service on the same host Complete is called twice.(We also experienced the success callback being called twice). Someone posted a bug about it http://dev.jquery.com/ticket/5383 . Does anybody else has this problem? If so, what is your solution? I use a local boolean variable to check whether the Complete was already called. However this does not feel good. Example: function myFunc(fComplete, arg1) { var completeNotCalled=true; function fGuardedComplete(data, textMessage)
making a diolog box open another dialog box... Why does it only work once?
hello, I am trying to get a dialog box to open another dialog box. Clicking on "more search options" the first time results in opening a dialog box. Clicking "search" within the dialog box results in opening up a second dialog box. But this only works the first time I click on "more search options". In other words, the second dialog box only opens up only once. To get the second dialog to open again, I have to reload the page in the browser. Does anyone have any idea why this is happening?
Opera 10.50Beta problem
Hi is there any bug known with jQuery and Opera 10.50b? I use some part of code under 10.50b and I have some problems to display ajax result. Under latest stable all is OK. Firebug doesn't show any errors. It's my code: $.preloadImages("/images/popup-ajax-loader.gif"); // Define loader IMG dimensions var ajaxLoaderW = 66; var ajaxLoaderH = 66; /////////////////////////////// var popup_div = '<div class="popup_layer"><div class="popup_layer_bg"></div><div class="popup_layer_content"><img id="ajax_loader_img"
wierd problem with $.each
data.items is an array from an ajax request which returns a json. alert(data.items.length) before of this snippet returns 12, which is correct. alert(data.items.length) $.each(data.items,function(index, item){ //alert(item) if (!$.isArray(item)) { arr = hashtoArray(item); } else {
animate ajax content
hi guys how to load some content through a ajax call en and show it on the page with an animation. jQuery(document).ready(function() { $('.accordion .row').click(function() { var test = $(this); $(test).children("div").toggle('slow'); $.get('/search/test.html', function(data) { $(test).append(data).show(); //this is not working }); }); });
Form.submit() submits to blank page
var checkStock = function(){ var validated = false; $("form").submit(function(e){ e.preventDefault(); var form = $(this); // <- here i cached $(this) so we can use it later. var data = true; if (!validated) { /* var naam =$('#inputString').val(); if(naam == ""){ $('#alert2').html('Gelieve naam in te vullen'); $('#alert2').css({'background-color' : 'red', 'color' : 'white'}).show();
JSON...send JSON data to index.php...
Ok so basically I want to send an array to a PHP page. It will look something like this... Array ( [a] => Array ( [user] => 'Josh' [user_id] => '2' [admin] => '0' ) [b] => Array ( [user] => 'David' [user_id] => '3' [admin] => '1' ) [C] => Array ( [user] => 'Mark' [user_id] => '4' [admin] => '0' ) ) Array ( [a] => Array ( [user] => 'Josh' [user_id] => '2' [admin] => '0' ) [b] => Array ( [user] => 'David' [user_id] => '3' [admin] => '1' ) [C] => Array
.load() page <script> problem... [hard to summaries a title for this issue...]
Hi, sorry... I don't know how to describe this problem or give a good title... but, try this out on any of your page... $( '#btn' ).click(function(){ $( '#container' ).load('testing.html'); }); and put this inside testing.html <script type='text/javascript'> $( document ).ready(function(){ $( '#testing' ).text('executed'); }); </script> <div id='testing'>no script</div> try to click the button#btn 3 times... you will find the loaded testing.html will only run the script 2 times.. then it will show
Problem using a variable in a selector
hello Any idea why this works $("#test a:first[rel*='modal']").css("background-color", "red") and this does not!!! var testing='modal'; $("#test a:first[rel*=testing]").css("background-color", "red");
Can’t request function from the file
Hello, I have js file with some functional with declared like (function($){ function f1() { }); })(jQuery); is it possible to requests functions f1() out of this file? I can't the change file, the full version of script you can see in attachment (I need find way to use funct. addRow). I tried to request function like jQuery.f1(), but I have message that f1 is not the functions. What I'm doing wrong? Thanks!
.load() loading very small files slowly
I'm starting to use JQuery ajax and am seeing a second-2 delay in the loading of a line of text when I click on the link. Here is the JQuery code $("a").click(function(e){ e.preventDefault(); e = this; $(".selected").removeClass("selected"); $(this).addClass("selected"); $("#content").slideUp('fast',function(){$(e.hash).load(e.href); }); $("#content").slideDown(); }); Content should load when the slideUp is done but it normally doesn't change
Can this be done in Jquery?
Hi ya, not sure what technology I should be looking at for this one? Jquery perhaps? Basically a client wants a site similar to this: http://www.timothy-hogan.com/ but not too keen on the Flash elements of it. So I was wondering can a slidey up navigation at the bottom like that be created any other ways. Would need to slide up to show thumbnails and then correspond the thumb to the large image. Please advise. Thanks Tracy
Need to get value of a cloned row select element
Hi, I'm using clone row to add rows to a table within a form. I now need to get the selected value of the drop down that has the new rowid as part of the select name. I have JS code that gets the value of the existing rows using $("#bdgttype"+id).val(); where id is the row id. When I add a row, for example row 6 is added, the id is passed on the keyup event and it is 6, but the code above does not return anything. Any help would be greatly appreciated.
Select all items where id contains a string
Hey All, The functionality I'm trying to accomplish is a show/hide of all items in a particular group. so I'm trying to toggle all the items where the element id contains a certain string. i.e "Lamps" or "Switches" The string is used in several id's. ie <tr id="HeaderRowLamps"> and <img src="toggle" id="toggleLamps"/> The id string itself is dynamically generated in the XSLT, ie. <tr id="HeaderRow{CategoryName}"> etc. I thought maybe using the Attribute Contains Selector would work but I'm
Custom protocol in text field
hi, i want to add text in a text field when somebody changes or edit a item with editform.aspx. for example: change of status-->log in text field: current user changes status to solved all changes should be in one field. is it possible? that's my code...but i don't get the text in text field to add new text. var arrKommentare = ['Kommentare']; var originalText = $(fields['Kommentare'].find('input').val(); $(fields['Kommentare']).find('input').val(originalText +"\n\nYournewtext");
jquery .live and ajax not working in ie
I am blending jquery with codeigniter. jquery .live and ajax will not work in ie. The process works fine in chrome and firefox; but not in ie. However, when I open ie's dev tools and insert a breakpoint in my jq file, it will start working, and keep working even after I remove the breakpoints. If I close and reopen the ie browser it fails, until I repeat the process. No other changes were made. Any ideas. Thanks Rick
How to make Jquery.load loads a page that also contains Javascript commands like an alert() inside of the page it is loading.
Hi I'm trying to load a page that also contains JQuery/javascript Code. For Example, I tried with a simple alert and it didn't pop up the alert. Doesn't JQuery.load load javascript code? Example Used: $(document).ready(function(){ $('#mainContent').load("test.php"); }); //TEST.PHP <?php echo "This message appears but not the Javascript Alert"; ?> <script type="text/javascript"> alert("Testing the Ajax Load"); </script> The PHP tag appears in the load, but not the Javascript code.
Performance of custom attribute selectors
Hi all, Can anyone explain the performance impact of using custom attribute selectors? e.g., For the markup: <input type="text" itemCode="item1" value="20"/>, I'm using selectors like: $('input[itemCode="item1"]'); There are a number of dynamically added controls, which store few id's in their custom attributes. I have to loop through and select controls based on these custom attributes. However, when I am using these selectors, I'm getting "long running script" dialogue in IE8. It works fine in
Help with simple jquery fade slideshow
Hello all! I'm new to jquery. I'm trying to integrate a simple slideshow with Wordpress. I managed to show the post thumbnail but I can't figure out how to display the_content(); I'm replicating this slide http://kyletalbott.com/jquery-examples/numbered.html I have the HTML like this <div id="demo"> <div id="title"></div> <div id="slideshow" class="pics"> <?php query_posts('category_name=featured&showposts=10'); ?> <?php while (have_posts()) : the_post(); ?> <?php the_post_thumbnail();
element as static class ?
Maybe this is inappropriate jquery usage... but I'm developing a module based application where each "module" is contained in a div and it would be nice to declare methods for each module and be able to call them without instantiating a class instance or using extra objects, like so: $("#module-one").start(); $("#module-two").start(); $("#module-three").start();Where start() is defined differently for each of these implementations. Maybe I just don't understand the framework very well. In comparison
Need some help working with checkboxes..
Looking how to put some sort of check so that if two checkboxes within the same ul are checked, at least once anywhere on the page, button "Two" does not get enabled.. I probably need to have some sort of loop checking each ul maybe?? I have cut the code down to a bare minimum, but there are many ul being created on the page dynamically.. Not just two like in this example.. Here is sample script.. <script src="http://code.jquery.com/jquery-latest.js"></script> <script> $('input.choice').live('click',
Multiple items for click event
I have an image next to a checkbox and if either of them are clicked I want to run the same function. I've tried these so far $("#chkHighlight,#imgDirFlag").click(function() $("#chkHighlight #imgDirFlag").click(function() Thanks
Next Page