Search Results

Search found 77 results on 4 pages for 'jq'.

Page 1/4 | 1 2 3 4  | Next Page >

  • jq div display script webkit issues

    - by Tom
    $(document).ready(function() { $('#chekboxes a').click(function(e) { $('.visible').removeClass('visible').addClass('invisible'); var thediv = $(this).attr('href'); $(thediv).removeClass('invisible').addClass('visible'); }) }); This simple bit of jq works in FF and not in Chrome and Safari. Despite googling widely, I cannot tell whether there's a way to make it work in Safari and Chrome or not. Does anyone know a fix or what is wrong ? Thanks, Tom

    Read the article

  • Overlaying image also fades when images change in IE6 jQ slideshow

    - by Hege Rokenes
    I have a pretty basic slideshow fading between images. On top of that slideshow I have a logo that is absolute positioned to stay partly over the slideshow. It works perfectly, but then there is IE6. In IE6 the part of the logo that is overlaying the slideshow also fades when the images change in the slideshow. I really do not want to have half the logo in all the pictures in the slideshow, but that seems to be the only solution right now. Demo of the problem here: http://nonstopas.no/temp/slideshow/ Note that this happens a bit inconsistently (or so it seems), so watch it for a couple of rounds.

    Read the article

  • JQuery: combine two jq selectors

    - by Bruno
    Hi there. Im sure the solution is simple but I cant figure it out :( I need to combine two jquery selectors in one selector: $(this) + $('input[type=text]:first') $(this) is e.g div#selected so the result should be: $('div#selected input[type=text]:first').focus(); How to do?

    Read the article

  • jQuery - I'm getting unexpected outputs from a basic math formula.

    - by OllieMcCarthy
    Hi I would like to start by saying I'd greatly appreciate anyones help on this. I have built a small caculator to calculate the amount a consumer can save annually on energy by installing a ground heat pump or solar panels. As far as I can tell the mathematical formulas are correct and my client verified this yesterday when I showed him the code. Two problems. The first is that the calculator is outputting ridiculously large numbers for the first result. The second problem is that the solar result is only working when there are no zeros in the fields. Are there some quirks as to how one would write mathematical formulas in JS or jQuery? Any help greatly appreciated. Here is the link - http://www.olliemccarthy.com/test/johncmurphy/?page_id=249 And here is the code for the entire function - $jq(document).ready(function(){ // Energy Bill Saver // Declare Variables var A = ""; // Input for Oil var B = ""; // Input for Storage Heater var C = ""; // Input for Natural Gas var D = ""; // Input for LPG var E = ""; // Input for Coal var F = ""; // Input for Wood Pellets var G = ""; // Input for Number of Occupants var J = ""; var K = ""; var H = ""; var I = ""; // Declare Constants var a = "0.0816"; // Rate for Oil var b = "0.0963"; // Rate for NightRate var c = "0.0558"; // Rate for Gas var d = "0.1579"; // Rate for LPG var e = "0.121"; // Rate for Coal var f = "0.0828"; // Rate for Pellets var g = "0.02675"; // Rate for Heat Pump var x = "1226.4"; // Splittin up I to avoid error var S1 = ""; // Splitting up the calcuation for I var S2 = ""; // Splitting up the calcuation for I var S3 = ""; // Splitting up the calcuation for I var S4 = ""; // Splitting up the calcuation for I var S5 = ""; // Splitting up the calcuation for I var S6 = ""; // Splitting up the calcuation for I // Calculate H (Ground Sourced Heat Pump) $jq(".es-calculate").click(function(){ $jq(".es-result-wrap").slideDown(300); A = $jq("input.es-oil").val(); B = $jq("input.es-storage").val(); C = $jq("input.es-gas").val(); D = $jq("input.es-lpg").val(); E = $jq("input.es-coal").val(); F = $jq("input.es-pellets").val(); G = $jq("input.es-occupants").val(); J = ( A / a ) + ( B / b ) + ( C / c ) + ( D / d ) + ( E / e ) + ( F / f ) ; H = A + B + C + D + E + F - ( J * g ) ; K = ( G * x ) ; if ( A !== "0" ) { S1 = ( ( ( A / a ) / J ) * K * a ) ; } else { S1 = "0" ; } if ( B !== "0" ) { S2 = ( ( ( B / b ) / J ) * K * b ) ; } else { S2 = "0" ; } if ( C !== "0" ) { S3 = ( ( ( C / c ) / J ) * K * c ) ; } else { S3 = "0" ; } if ( D !== "0" ) { S4 = ( ( ( D / d ) / J ) * K * d ) ; } else { S4 = "0" ; } if ( E !== "0" ) { S5 = ( ( ( E / e ) / J ) * K * e ) ; } else { S5 = "0" ; } if ( F !== "0" ) { S6 = ( ( ( F / f ) / J ) * K * f ) ; } else { S6 = "0" ; } I = S1 + S2 + S3 + S4 + S5 + S6 ; if(!isNaN(H)) {$jq("span.es-result-span-h").text(H.toFixed(2));} else{$jq("span.es-result-span-h").text('Error: Please enter numerals only');} if(!isNaN(I)) {$jq("span.es-result-span-i").text(I.toFixed(2));} else{$jq("span.es-result-span-i").text('Error: Please enter numerals only');} }); });

    Read the article

  • scrollTo inner div only

    - by Nik
    I have a page with two scroll bars. I am using the scrollTo jquery plugin to jump to other areas on the same page. The problem is I only want the inner div to scrollTo and the outer div to remain at the top of the screen. Development site link click here This is the script $(".jump > li").click(function() { var qu = $(this).attr("id"); var an = "#" + qu.replace("q","a"); // step 8 $.scrollTo(an, {duration: 800, axis:"y"}); }); Any ideas?

    Read the article

  • flash video covering JQueryUI model dialog

    - by user200295
    I have a site with a flash SWF on the home page. I have a login dialog that is displayed using the jquery ui modal. The modal dialog is being covered by the SWF movie when it opens. I tried setting the z-index etc but nothing seems to stop the SWF from covering the log in. Is there any way to force the SWF movie to the background? The SWF uses src="support/AC_RunActiveContent.js" if that helps isolate the version.

    Read the article

  • caching the form values

    - by ha22109
    Hello , I have a search form.When user post the search form i take the user to the result page which has search form and results of the search.Now if the user click on the back button of the browser ,i want that he should be the search page form filled with his values.I am using java

    Read the article

  • how to change onclick event with jquery?

    - by user550758
    I have create a js file in which i am creating the dynamic table and dynamically changing the click event for the calendar but onclicking the calender image for dynamic generated table, calendar popup in the previous calendar image. Please help me code /***------------------------------------------------------------ * *Developer: Vipin Sharma * *Creation Date: 20/12/2010 (dd/mm/yyyy) * *ModifiedDate ModifiedBy Comments (As and when) * *-------------------------------------------------------------*/ var jq = jQuery.noConflict(); var ia = 1; jq(document).ready(function(){ jq("#subtaskid1").click(function() { if(ia<=10){ var create_table = jq("#orgtable").clone(); create_table.find("input").each(function() { jq(this).attr({ 'id': function(_, id) { return ia + id }, 'name': function(_, name) { return ia + name }, 'value': '' }); }).end(); create_table.find("select").each(function(){ jq(this).attr({ 'name': function(_,name){ return ia + name } }); }).end(); create_table.find("textarea").each(function(){ jq(this).attr({ 'name': function(_,name){ return ia + name } }); }).end(); create_table.find("#f_trigger_c").each(function(){ var oclk = " displayCalendar(document.prjectFrm['"+ ia +"dtSubDate'],'yyyy-mm-dd', this)"; //ERROR IS HERE var newclick = new Function(oclk); jq(this).click(newclick); }).end(); create_table.appendTo("#subtbl"); jq('#maxval').val(ia); ia++; }else{ var ai = ia-1; alert('Only ' + ai + ' SubTask can be insert'); } }); });

    Read the article

  • A smarter way to do this jQuery?

    - by Nicky Christensen
    I have a a map on my site, and clicking regions a class should be toggled, on both hover and click, I've made a jQuery solution to do this, however, I think it can be done a bit smarter than i've done it? my HTML output is this: <div class="mapdk"> <a data-class="nordjylland" class="nordjylland" href="#"><span>Nordjylland</span></a> <a data-class="midtjylland" class="midtjylland" href="#"><span>Midtjylland</span></a> <a data-class="syddanmark" class="syddanmark" href="#"><span>Syddanmark</span></a> <a data-class="sjaelland" class="sjalland" href="#"><span>Sjælland</span></a> <a data-class="hovedstaden" class="hovedstaden" href="#"><span>Hovedstaden</span></a> </div> And my jQuery looks like: if ($jq(".area .mapdk").length) { $jq(".mapdk a.nordjylland").hover(function () { $jq(".mapdk").toggleClass("nordjylland"); }).click(function () { $jq(".mapdk").toggleClass("nordjylland"); }); $jq(".mapdk a.midtjylland").hover(function () { $jq(".mapdk").toggleClass("midtjylland"); }).click(function () { $jq(".mapdk").toggleClass("midtjylland"); }); } The thing is, that with what i've done, i have to make a hover and click function for every link i've got - I was thinking I might could keep it in one hover,click function, and then use something like $jq(this) ? But not sure how ?

    Read the article

  • JavaScript DOM dimension properties (height, width) vs. jQuery dimension methods

    - by powerboy
    Take height for example. JQ height() <=> JS height // WITHOUT padding, border and margin, including invisible areas JQ innerHeight() <==> JS ??? // WITH padding, WITHOUT border and margin, including invisible areas JQ outerHeight(false) <==> JS ??? // WITH padding and border, WITHOUT margin, including invisible areas JQ outerHeight(true) <==> JS ??? // WITH padding, border and margin, including invisible areas JQ ??? <=> JS offsetHeight // WITH padding and border, WITHOUT margin, NOT including invisible areas JQ ??? <=> JS clientHeight // WITH padding, WITHOUT border and margin, NOT including invisible areas Please help me to correct and complete the list.

    Read the article

  • Jquery ajax ($.ajax) not working on chrome. please help

    - by racky
    Hi, I need a little help to figure out why the following code does not work on google chrome 5/windows xp. It works well on all other browsers (IE, FF, Safri, Opera etc). Can someone shed some light around this? /* AJAX Request */ jq("#a-post-request").unbind("click").bind("click", function(e){ //jq("#loading").css({"display":"block"}); jq.ajax({ url: "search_data_table.html", type: "get", cache: false, error: function(){alert ("No data found for your search.");}, success: function(data){ jq("#search-results-table tbody").empty().append(data); jq("#search-results").css({"display":"block"}); jq("#search-results-table").trigger("update"); // this one is for the table sorter plugin // set sorting column and direction, this will sort on the first column. var sorting = [[0,0]];// this one is for the table sorter plugin // sort on the first column . jq("#search-results-table").trigger("sorton",[sorting]);// this one is for the table sorter plugin e.preventDefault(); } }); }); Many thanks, Racky

    Read the article

  • Asp.net MVC jQuery Ajax calls to JsonResult return no data

    - by Maslow
    I have this script loaded on a page: (function() { window.alert('bookmarklet started'); function AjaxSuccess(data, textStatus, xmlHttpRequest) { if (typeof (data) == 'undefined') { return alert('Data is undefined'); } alert('ajax success' + (data || ': no data')); } function AjaxError(xmlHttpRequest, textStatus, errorThrown) { alert('ajax failure:' + textStatus); } /*imaginarydevelopment.com/Sfc*/ var destination = { url: 'http://localhost:3041/Bookmarklet/SaveHtml', type: 'POST', success: AjaxSuccess, error: AjaxError, dataType: 'text',contentType: 'application/x-www-form-urlencoded' }; if (typeof (jQuery) == 'undefined') { return alert('jQuery not defined'); } if (typeof ($jq) == 'undefined') { if (typeof ($) != 'undefined') { $jq = $; } else { return alert('$jq->jquerify not defined'); } } if ($jq('body').length <= 0) { return alert('Could not query body length'); } if ($jq('head title:contains(BookmarkletTest)').length > 0) { alert('doing test'); destination.data = { data: 'BookmarkletTestAjax' }; $jq.ajax(destination); return; } })(); when it is run locally in VS2008's cassini the ajax success shows the returned string from Asp.net MVC, when it is run remotely the ajax success data is null. Here's the controller method that is firing both locally and when run remotely: [AcceptVerbs(HttpVerbs.Post | HttpVerbs.Get)] public string SaveHtml(string data) { var path = getPath(Server.MapPath); System.IO.File.WriteAllText(path,data); Console.WriteLine("SaveHtml called"); Debug.WriteLine("SaveHtml called"); //return Json(new { result = "SaveHtml Success" }); return "SaveHtml Success"; } Once i have it working I was going to remove the GET, but currently accessing the SaveHtml method directly from the webbrowser produces the expected results when testing. So there's something wrong in my javascript I believe, because when I step through there with chrome's developer tools, I see the data is null, and the xmlHttpRequest doesn't appear to have the expected result in it anywhere either. I'm loading jquery via http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js

    Read the article

  • Some jQuery-powered features not working in Chrome

    - by Enchantner
    I'm using a jCarouselLite plugin for creating two image galleries on the main page of my Django-powered site. The code of elements with navigation arrows is generating dynamically like this: $(document).ready(function () { $('[jq\\:corner]').each(function(index, item) { item = $(item); item.corner(item.attr('jq:corner')) }) $('[jq\\:menu]').each(function (index, item) { item = $(item); item.menu(item.attr('jq:menu')) }) $('[jq\\:carousel]').each(function(index, item) { item = $(item); var args = item.attr('jq:carousel').split(/\s+/) lister = item.parent().attr('class') + '_lister' item.parent().append('<div id="'+ lister +'"></div>'); $('#' + lister).append("<a class='nav left' href='#'></a><a class='nav right' href='#'></a>"); toparrow = $(item).position().top + $(item).height() - 50; widtharrow = $(item).width(); $('#' + lister).css({ 'display': 'inline-block', 'z-index': 10, 'position': 'absolute', 'margin-left': '-22px', 'top': toparrow, 'width': widtharrow }) $('#' + lister + ' .nav.right').css({ 'margin-left': $('#' + lister).width() + 22 }) item.jCarouselLite({ btnNext: '#' + lister + ' .nav.right', btnPrev: '#' + lister + ' .nav.left', visible: parseInt(args[0]) }) }) The problem is that if page is loaded through an url, typed in the adress bar, some functions doesn't work and the second gallery appears with the wrong parameters, but if I came to this page via clicking link - everything works perfectly. It happends only in Google Chrome (Ubuntu, stable 5.0.360.0), but not in Firefox or Opera. What could be the reason?

    Read the article

  • Validate that a Checkbox is checked using javascript

    - by H(at)Ni
    I was facing a challenge yesterday that I was creating a Visual webpart and I wanted to validate the a submit button is only visible if the user checked a "I agree to terms" checkbox. Something was weired that I tested my code on a normal asp.net website and it worked perfectly while it had a different behaviour inside the webpart which is whenever I check the checkbox, the button is enabled but it will not fire the asp.net validators in client side. It posts back the page and then the validators appear after that. So, I tried to change my type of thinking and I reached a different solution is that to call a javascript function whenever the button is clicked and then check if the checkbox is clicked or not. To illustrate more, here are an example to what I'm saying: 1. Button in aspx page: <asp:Button OnClientClick="CheckForCondition();"  ValidationGroup="CompaniesSection" ID="btnCompaniesSubmit"                         runat="server" Text="Submit" /> 2. CheckForCondition() function: <script language="javascript" type="text/javascript">                         function CheckForCondition() {                             if ($jq('#<%= ChkCompanyCheck.ClientID %>:checked').val() == undefined) {                                 $jq('#lblCheckBox').show();                                 return false;                             }                             else {                                 $jq('#lblCheckBox').hide();                                 return true;                             }                         }                      </script> 3. lblCheckBox is simply a label that shows a red asterisk beside the checkbox to indicate that it's a required field. <label id="lblCheckBox" style="color:Red;display:none">*</label>

    Read the article

  • How can I get jQuery $('.class', context) to include context itself if it matches .class?

    - by Jake
    I want to be able to match against all elements in a given context including the context element itself. Here is the code I'm using currently, but it seems inefficient. Is there a better way? Note: I'm using jQ 1.3.2, but I'll upgrade soon so I'm interested in 1.4 solutions too. var context = $('#id'); var filters = '.class1, .class2'; // take context itself if it matches filters $(context).filter(filters) // add anything matching filters inside context .add($(filters, context)) Note: .add($(f,c)) works in jQ 1.3 as .add(f,c) in jQ 1.4

    Read the article

  • jquery: why a selector returns me an array, but attribute doesnt?

    - by Shlomi.A.
    Hi. I'm trying to understand JQ better. I'm calling an JQ object $(".FamiliesList li li span[class!='']").prev().find('option:selected') this returns back to me an array of all the options that their span parent's brother has a classname. [option, option] Now- I want to return back an array of the option's values $(".FamiliesList li li span[class!='']").prev().find('option:selected').attr('value') this returns back to me only the first child value, and a full array of the values. Why? I would appreciate to receive help and understand jq better :) Thanks.

    Read the article

  • jQuery-ajax call: async property is not working?

    - by user269386
    Hi, given to certain circumstances, I'm forced to keep page settings (Javascript-values) in the session and it has to be done right before leaving the page (I can't use cookies, since "pageSettings" can become quite large and localStorage is not an option yet ;) ). So this is how I tried it. However it seems that when I call the page directly again, the call of "http://blabla.com/bla" happens asynchronous, even though the async-attribute is set (I don't receive the settings of the previous call, but of the one before): $jQ(document).ready(function () { $jQ(window).unload(Main.__setSessionValues); }); var Main = { pageSettings: {}, __setSessionValues: function __setSessionValues() { $jQ.ajax({ type: "POST", async: false, url: "http://blabla.com/bla", data: { pageSettings: Object.toJSON(Main.pageSettings) } }); } }; Does anyone know what the problem might be? thanks in advance

    Read the article

  • Is there a snippets program that allows for tab entry of variables across the mac?

    - by Jeremy Smith
    I love Sublime Text editor and the ability to create code snippets like so: <snippet> <content><![CDATA[\$("${1:selector}").${2:method}]]></content> <tabTrigger>jq</tabTrigger> </snippet> This allows me to type jq[tab] and then have it expand to $("selector").method where I am able to tab through the string 'selector' and 'method' in order to change them. But what I'd really like to do is use this same snippet when working in Chrome Dev Tools, so I was looking for a mac snippets program that could support this. However, the three programs that I looked at (Keyboard Maestro, Snippets, CodeBox) don't support the ability to tab through to highlight predetermined strings and change them. Does anyone know of an app that will do this?

    Read the article

  • jQuery selectors with meta-characters

    - by steamboy
    Hello Guys, I'm having problem selecting an element with an id like this <li ="0f:Bactidol_Recorder.mp4">. I tried using the function that escapes meta-characters with two backslashes below from this jquery link but still can't select the element Function: function jq(myid) { return '#' + myid.replace(/(:|\.)/g,'\\$1'); } Example: $(jq('0fb:Bactidol_Recorder.mp4')).empty() Output: $(#0fb\\:Bactidol_Recorder\\.mp4).empty();

    Read the article

  • How to remove JQuery from the Window/make the GC take it.

    - by Itay Moav
    I have a page, when loaded it does some stuff with JQ. In the next phase I want to load mootools and remove all JQ stuff, to avoid collisions and to avoid memory leaking. I am not giving you the all picture (to simplify the question), but assume I am not doing something stupid here, and it needs to be done how I am asking it.

    Read the article

  • Drop Down list null value not working for selected text c#?

    - by Tamara JQ
    Hi guys, Basically I have a drop down list which is populated with text and values depending on a selected index of a radio button list. The code is as follows: protected void RBLGender_SelectedIndexChanged(object sender, EventArgs e) { DDLTrous.Items.Clear(); DDLShoes.Items.Clear(); if (RBLGender.SelectedValue.Equals("Male")) { String[] MaleTrouserText = {"[N/A]", "28\"", "30\"", "32\"", "34\"", "36\"", "38\"", "40\"", "42\"", "44\"", "48\""}; String[] MaleTrouserValue = { null, "28\"", "30\"", "32\"", "34\"", "36\"", "38\"", "40\"", "42\"", "44\"", "48\"" }; String[] MaleShoeText = { "[N/A]", "38M", "39M", "40M", "41M", "42M", "43M", "44M", "45M", "46M", "47M" }; String[] MaleShoeValue = { null, "38M", "39M", "40M", "41M", "42M", "43M", "44M", "45M", "46M", "47M" }; for (int i = 0; i < MaleTrouserText.Length; i++) { ListItem MaleList = new ListItem(MaleTrouserText[i], MaleTrouserValue[i]); DDLTrous.Items.Add(MaleList); } for (int i = 0; i < MaleShoeText.Length; i++) { ListItem MaleShoeList = new ListItem(MaleShoeText[i], MaleShoeValue[i]); DDLShoes.Items.Add(MaleShoeList); } } else if (RBLGender.SelectedValue.Equals("Female"))` When the text '[N/A]' is selected I want the value NULL to be inserted into the database. At present when '[N/A]' is selected the value entered into the database is [N/A] does anyone know why? Thanks in advance.

    Read the article

  • How to use/manipulate return value from nested boost::bind

    - by JQ
    I have two functions: 1. A & DataSource(); 2. void DataConsumer( A * ); What I want to achieve: Using one statement to assemble them into one functor. I have tried: 1. boost::function< void() func( boost::bind( DataConsumer, & boost::bind( DataSource ) ) ); certainly it didn't work, compiler says it can not convert 'boost::_bi::bind_t ' to 'A *' 2. boost::function< void() func( boost::bind( DataConsumer, boost::addressof( boost::bind( DataSource ) ) )); compiler says cannot convert parameter 1 from 'boost::_bi::bind_t' to 'A &' Question: how to use return value from the nested boost::bind ? or if you want to use boost::lambda::bind.

    Read the article

  • Use super class's address/pointer in initialization list

    - by JQ
    context 1: class D : public B1, public B2{}; context 2: B2 takes B1 to initialize: B2( B1 * ) //B2's constructor my question is in D's initialization list: D::D() : B1(), B2( ? )... What should be in ? I don't want to put " (B1*)this " in the ? place, because it's no good to use "this" in initialization list. And since B1 part has been initialized, it makes sense to use it. What should I do ?

    Read the article

1 2 3 4  | Next Page >