problem with gallery formatter (jquery in drupal)
Hi there! I am having a problem with a script called gallery formatter, used to tie thickbox and infinitecarousel together in javascript. I've copied the code below for convenience. Basically what this does is make a nice jcarousel style image gallery while drawing from some drupal resources. A series of thumbnails are displayed. When you click, the main image is shown. I believe this action is described by $thumbslinks.click(function(e){ $hash = $(this.hash); //alert ($hash.is(':visible'));
Is to possible to check if link is to an image
Hey I'm trying to use jQuery to trigger a light box for images contained in a hyperlink inside a content area, The code snippet should help to show what i mean. <div id="contentcontainer"> <a href="www.site.com/image.jpg"> <img src="www.site.com/image_thumb.jpg" /> </a> </div> Is it possible for jQuery to detect the link above is to an image? to assign a class to it. Thanks Phil
Display inner DIV within outer DIV without outer DIV expanding (i.e. while hovering over)
I want to avoid the inner DIV to expand the outer DIV when I hover over the outer DIV and fadeIn the inner DIV. How can I hover over the outer DIV and show the inner DIV without the height of the outer DIV expanding? Thanks for your help!
An addition to the documentation
Hi there, I just found a solution to an issue with an event handling IE peculiarity which is not a bug of jquery. I believe someone among the maintainers should mention this in the documentation about bind, mouseout and mouseleave so that others can avoid wasting hours in order to find it. The issue is as follows: when one binds a handler for the mouseout or mouseleave events to an element which contains other html elements then IE fires the event and invokes the handler when the mouse leaves the
How to display unique Error message for when they are part of groups
I am new in jQuery. Need to validate a form. I am trying to validate a USA address. I have attached a screenshot for that. Basically I have to display common error message like "Please enter a city & state" when both city and state are missing and user click on submit button. And when user enters city, it should display "Please enter state". Alternatively when user enters state, it should display "Please enter state". I tried the "groups" functionality to display a common error message. But not
.find() returns empty array when trying to match input.class ($("input").addClass("test").find(".test"))
The .find() method does not seem to match on input fields by using a class. The ti This problem seems to be only visible on input fields. The following is a demonstration of the issue: Example at http://jsbin.com/oqowe4/2 Thanks all for your help.
Animating div height on rollover
This is a pretty simple question, however, I am no familiar with jquery yet, so simple is not easy for me. All I needs is for one div to have an animated height when another div is rolled over. Example: <div class="button"></div> <div class="animatedBox"></div> So basically, I want the "animatedBox" div to have an animated expansion in height when the "button" div is rolled over. When the "button" div is rolled out, I would for the "animatedBox" div to go back to the original height. Let's go ahead
Horizonotal Accordion bouncing and clicking on active
Hey guys... I have implemented a horizontal accordion and every time I click on an item and as it slides it shifts like it bounces. how can I stop that from happening? Second thing, when I click on an active slide, it closes and open again. how can I have the active slide be disabled? example of this is on www.jaypengo.com Code is as follows: jQuery.fn.extend({ haccordion: function(params){ var jQ = jQuery; var params = jQ.extend({ speed: 400, headerclass: "header",
Multidimensional array
Hi Everyone, I have the following array: var cars = [["Mercedes-Benz", "CL63 AMG", "V8"], ["Aston Martin", "DBS", "V12"]]; When I do: alert(cars[0]); I get to see the Mercedes, which is good. However when I try: $('#my_div_id").text(cars[0]); I don't see anything. What am I doing wrong? Any suggestions are welcome. Thanks. - Jermaine
Show Div Based on checkbox's checked
Hello, I have a list of about 20 check boxes and I want a div to show when 3 have been selected as "Yes" option, how do i go about doing this? Here is my html code: <form> <ul id="quiz-list"> <li>1. My bed partner complains that I snore. <input id="select1" name="snore" type="radio" value="Yes" class="static_class style1" />Yes <input name="snore" type="radio" value="No" />No</li> <li>2. My bed partner says I hold my breath while asleep. <input name="snore" type="radio" value="Yes" />Yes
making tabs automatically change
i have it so my tabs will fade in/out when i click on them using the UI, how do i make this action happen automatically after a certain period of time even if they havent changed the current tab manually? $(document).ready(function() { $("#tabs").tabs({ fx: { opacity: 'toggle' } }, { selected: 1 }); }); <div id="tabs"> <div id="fragment-1"> <h1>One</h1> <p>This is a test tab.</p> </div> <div id="fragment-2"> <h1>Two</h1> <p>This
Calling an action in .ajax success timing incorrect
Hello, I am performing a .ajax request, and as part of my success am calling two functions, loadPanes() which creates the different content panes and pushes them to the page, and removeLoader() which removes a div with a loading graphic to hide the content as it is being loaded and stacked on top of each other. It would seem that removeLoader() is being called before loadPanes() has a chance to finish though, as it is possible to see the content being loaded on the page (i.e. the loading graphic
Trouble getting value attribute of input element
I have a table with several columns containing input elements populated from a database, e.g., <input class="calc" type="text" value="5" /> //value populated by PHP On every row, I need to perform a calculation using the value of several input fields. So I tried to access the value of the first input field like so (which had worked in another function): var row = $(this).closest("tr"); ($(row).find('input:eq(0)').val(); But for some reason it's returning a 0, and the line below also doesn't work:
W3C validation error with <input> inside <script>
I have the follow code: <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#selectone').change(function() { if(jQuery('#selectone option:selected').text() == 'General'){ jQuery("form[id=search]").attr('action', '/portal/search'); jQuery('form[id=search]').attr('id', 'cse-search-box1'); jQuery("#hiding").html("<input type='hidden' name='cof' value='FORID:11' />"); }else{ jQuery('form[id=search]').attr('action', '/portal/business/search'); jQuery('form[id=search]').attr('id',
My Ajax needs page refresh. Why??
HI, I have a table which contains meeting minutes. Each row has an option to delete a meeting minute. Everything works fine in via the ajax calls to my backend php script including the calling up the view fragment replaces the table in it's div holder with refreshed data minus the record i just deleted. At this point however I am not able to use the delete option again with out refreshing the page. It is as though the new table can not see the jquery script whcih is in the page header. I have
Need advice, Ajax or not ?
Hi, I am developping an interface that allows to manage bookings for a selected week. You can add, delete, view a booking. When you open a client's booking, I could fetch the id from some div, call an ajax request, and load the booking's data in some dialog (client's data, booking info (date, hour, description, ..)). I don't wish to forward the manager to another page (another request). But another option, would be to load all the client's data of the selected week (may be up to 100) into a hidden
Internet Explorer 8 and each() problem
I have been trying to create a function that creates a table of content automatically. It works nicely on Firefox 3.6, but not on Internet Explorer 8. The problem seems to be that the each() method is not executed on IE. It is skipped with no errors. I have tested the each() method on IE 8 before and it seems to work, but not on this occasion. I am using jQuery 1.4.2. Below is the code. var container = $("div#tocContainer"); var headerText = container.attr("title"); $("<h1>", { id: "tocHeader", text: headerText }).appendTo(container);
hide animated gif
Hi : I want an animated gif to play on a page for 5-10 seconds and then disappear. Below is the code I am using but it is not right. I'd appreciate help getting this to function properly. Also are their dependencies other than: jquery-ui-1.8.1.custom.css jquery.min.js jquery-ui.min.js Thanks! <head> <script type="text/javascript"> $(document).ready(function(){ $('#top').hide('1000') }); </script> </head> <body> <div id= "gif"> <img id = "top" class = "hide" src="file:///www.rkwalton.com/images/fire2.gif"
Show the inputed field in ajaxsubmitmessage
Hi all, Am using jquery.validationEngine.js plugin to validate my form and form is submited fine with every validation. What i need is, i have an field 'enter_name' in the form and need to show this field value in ajaxSubmitMessage area after submit the form. Here my code: [see the text with red color, i want to show the imputed field value in form <script type="text/javascript" lang="javascript"> /* Short Contact */ $(document).ready(function() { // SUCCESS AJAX CALL, replace "success: false,"
Centering a window around a FIXED DIV
Hi all, I have been having a bit of trouble solving a problem which I posted a little while ago (previous post) so am going down a secondary route. Is there a way of centering a window around a div. For example the width of a container is 4000px with 3 pages spaced at 3 different intervels from left to right. is their a way of centering the viewport in the middle of any of these DIVs? I have been using scrollTo which is great but aligns the anchor to the top left of the screen as you would
Pesky Popup Problems
Hi, I'm trying to make a very basic alerting system. I've basically got the following: var i=0; var s=$("[id^=dAlert]").last().attr("id"); if (s!=undefined){ i = parseInt(s.substring(6)); } $("<div id='dAlert"+(++i)+"'>An Alert</div>") .css({"border":"1px Solid Black","width":"50px","height":"20px","padding":"3px"}) .css({"display":"none","position":"absolute","top":(document.documentElement.clientHeight-(30*i))+"px","left":document.documentElement.clientWidth-80+"px"})
Is it possible to "Wait" for an element to appear?
I'm trying to style a fugly advertisement that pops in on my page. Right now I have a standard setTimeout going, but it could take 2 seconds, or 5 seconds after document.ready triggers :/ Is there a way to somehow put an event on a div to watch for an ID to appear perhaps? Thanks, Steve
Solved: jAlert appears in bottom of the page
Problem: Alert appears in internet explorer jquery 6-7-8 bottom of the page. Here's how to fix the bug: Solved: at row 80 of jquery.alerts.js change browser.version) <= 6 as show // IE6-7-8 Fix var pos = ($.browser.msie && parseInt($.browser.version) <= 8 ) ? 'absolute' : 'fixed'; Now jAlert appear in center of the page IE again. Files used: jquery.alerts.js - jquery.js - jquery.ui.draggable.js - jquery.alerts.css Hello, Danzisi
jQuery Object is not working in grome
Hi All, "Property 'jQuery' of object [object DOMWindow] is not a function" error throws when the iframe loading in google-chrome and also parent.jQuery is not working in iframe.Please Help me. Thanks, S.Kumaresan
function inside $(document).ready(function(){});
Hi, I want to have this code $(document).ready(function(){ function doSomething(){ alert('hello'); } }); in my HTML code I want to call function which is declared inside $(document.ready() <div onclick="doSomething();"></div> but this does not work. How can I call function from html, while function body is declared inside $(document).ready()? thanks for advise Tomas
Stats-tracker and crossdomain problem?
Hey, I want to do the following to track and view simple stats: 1. collect stats on page load include a .js snippet in a random page that sends some params to a certain URL (I guess GET is more suitable than POST because of the reload-warning) how would you do that? I think there might be problems with cross domain calls? I don't need to return a result or anything 2. get image url on page load a simple snippet/call on page load that fetches the stats-image url from an endpoint (same as above) and
Ajax response
Hi Folks, I am getting this response from server {"targetRequestUri":"/onePageCheckout","javax.servlet.request.key_size":128,"_CONTEXT_ROOT_":"/home/ankit/ofbiz_dev/jquery/specialpurpose/ecommerce/webapp/ecommerce/","javax.servlet.request.ssl_session":"4ca5f317564be1e1678fefa000004a66f4b99dc225826e28b18dc4a9983c7a90","_CONTROL_PATH_":"/ecommerce/control","javax.servlet.request.cipher_suite":"TLS_DHE_RSA_WITH_AES_128_CBC_SHA","_FORWARDED_FROM_SERVLET_":true,"_SERVER_ROOT_URL_":"https://localhost:8447","thisRequestUri":"json","_ERROR_MESSAGE_":"The
Working with dynamic content
Say I have the following code: $('.give-white-border').css('border': '1px solid #FFF'); This would be fine until I dynamically added another element with the class "give-white-border". I looked into .live() but while its a step in the right direction, Im not really binding an event. Could someone point me in the right direction?
Registering events within an object
I'm having a hard time figuring out how to refer to an object while inside a jquery event function. In the following example, "this" at first is referenced as #myDiv. But inside the draggable event, "this" refers to something else. I am not sure what it is referring to, but how do I reference the original object (Human) from within this event? var Person = new Human("#myDiv", "my data"); function Human(element, myName) { this.name = myName; $(element).draggable({ start: function() { alert(this.name);
RealKeyDown
Hi there, I'm only in my second year at college for computer science, and I also have just started using jQuery. I was curious if there was a method to make keyDown execute on press and immediately following, instead of having a delay. Similar to window's library's GetKeyboardState. I realize there is obviously many ways I can work around the various problems I will run into with a keydown delay. However if there was a function that would just make it work, I thought I would ask. Just in case I have
simple $.post() problem
i am totally confused about the function i made: my js inside <head> tag, after the jquery.js: <script type="text/javascript"> $(document).ready(function(){ function addasfriend(){ var n = $(this).attr('id'); $.post('test.php',{f:n},function(r){ alert("Newly added: " +r); }); } }); </script> my html <body> (ID tag = name_is_here, supposively the name of a person) <a href="#" id="name_is_here" onclick="addasfriend();">Add as friend</a> the test.php page
Simple div animation on rollover
Hello all, I am trying to do something relatively simple, however, I don't have much jquery experience, so simple is not so easy for me :) All I am looking to do is make one div expand its height when another is rolled over. <div class="button"></div> <div class="changingBox"></div> So basically, all I want is: When the viewer rolls over the "button" div, the "changingBox" div will animate it's height. Lets go ahead and say the height is originally 20px and I want it to animate to 50px on the rollover.
jquery load() function
Hello, I have problem with load content in jquery. i have file a.html and i have inside him <div id="content"></div> and i load other files using functions load $("#content").load('b.html'); and all works fine until inside of b.html i have flash video than scripts just not working. I have solution for it but im sure there is a better way (just don't know with :)). Inside of b.html i created a iframe and by it i load next html, and inside i put flash object and its working good. Still i prefer put object in
image on same page
Hi, im using an accordion menu. i would like to have the sub-menu items in that accordion menu when clicked on display an image in a "viewing box" of some sort beside it. is that possible? how would i go about it? any help would be appreciated!
Access hidden field value inside a child page
Hi! I just used .load() to display a page in a DIV (iframe replacement). And now i need to access a hidden field in the child page, but i'm getting a undefined value :( The hidden field on the child page: <asp:HiddenField ID="save" runat="server" Value="s" /> Here's how i'm trying to get the hidden field value from the parent page: value = $('#div').contents().find('#save').value; I only access the hidden field when the div is completely loaded. Can anyone tell me what i'm doing wrong?
Accordian with Colorbox - Accordian collapsed onload problem
I have a webpage with an Accordian and a colorbox. The conflicting problem is fixed by replacing all the '$' with '$j' in the js file, as someone suggested in the forum, and adding 'var $j = jQuery.noConflict()' to my html page. Now both the accordian and colorbox seems to be working fine. The new problem I am experiencing is that all the contents of the accordian are collapsed after the page loads. With just the accordian in the webpage without the colorbox, the contents of the first header
Help me! jquery is not working on ie,safari and opera
i am using this code which is load an image. on firefox and chrome is working fine but on safari,ie and opera is not working. can any one help me? thank you <div class="wrap"> <!-- #Header Start --> <div class="header"> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ var timezone = "Europe/Athens";
Can't get addClass() to work out side of $(document.ready)
I want to be able to call a js function from any where in my site and cause a class change. ex. in some .js function hightlight_memorial_menu(){ $("#the-fund-subnav #memorial_scholarship a").addClass('active'); } js in some page: <script type="text/javascript" language="JavaScript"> hightlight_memorial_menu(); </script>The problem is that when the function is called nothing happens... if my code is in the doc.ready function it works fine. I don't think I'm doing anything wrong, but maybe someone
Body width on resize
Hi there I'm having a problem where two elements that are both centred appear to be out of alignment by one pixel when resizing - I'm sure this is due to the fact that if the browser is an odd number of pixels, then one or more elements positioned by % or em are actually on half or sub-pixels. My question is, would jquery be a good solution? I can't even imagine how to begin writing the code, wondering if someone else has come across this? I'm thinking along the lines of "check on load or resize
Accordian and Colorbox together - Accordian doesn't expand after load
I am using an accordian and a colorbox in the same webpage. I've replaced all the '$' with '$j' as someone from the forum suggested and included the 'var $j = jQuery.noConflict()' js tag in my html page. Everything seems to be working fine now. The new problem I have now is that all my accordian contents are collapsed after loading whereas before, the first header's content will automatically be expanded upon load. I can still click my headers and get the contents but upon load of the page, it
Next Page