Search Results

Search found 60 results on 3 pages for 'danit'.

Page 3/3 | < Previous Page | 1 2 3 

  • Set background based on SPAN contents

    - by danit
    I need to set a different background image dependant on the contents of a SPAN: <div class="replies"> <span>2</span> </div> If SPAN = 1 background-image: url('reply.png') no-repeat; If SPAN = 'anything other than 1' background-image: url('replies.png') no-repeat; Can this be done in jQuery?

    Read the article

  • IE8 doesnt like my jQuery

    - by danit
    Can anyone see any reason why IE8 might not run this jQuery? $("#slid").toggle( function() { $("#Silver").animate({top: "25px"}, 200); }, function() { $("#Silver").animate({top: "89px"}, 200); } ); It runs the first function but ignores the 2nd top: "89px" and ideas? Or a better way the same toggle effect can be achieveD?

    Read the article

  • Call a Javascript Function with Jquery

    - by danit
    I have two functions in Javascript: function getWindowWidth(){ var x = 0; if (self.innerHeight){ x = self.innerWidth; }else if (document.documentElement && document.documentElement.clientHeight){ x = document.documentElement.clientWidth; }else if (document.body){ x = document.body.clientWidth; }return x; }function getWindowHeight(){ var y = 0; if (self.innerHeight){ y = self.innerHeight; }else if (document.documentElement && document.documentElement.clientHeight){ y = document.documentElement.clientHeight; }else if (document.body){ y = document.body.clientHeight; } These appear to set the height and width of the document window, based on the size of the window? I could be wrong here.... What I have done is embeded a toolbar above this document, this toolbar can be hidden or shown at various points. I need the above function to be called when I use the following jQuery, $("#Main").animate({top: "89px"}, 200); Any assistance greatly appreciated!

    Read the article

  • jQuery if and logic

    - by danit
    I have a simple jQuery toolbar, the basic functionality is: Hover: Background change to defined value & add .active class OnClick: Move the icon down 4px, and change background of the toolbar to that of the element What I would like to do move the icon down 4px when it has the class 'active' applied, however also remove the onclick event? Somehow I need an 'IF' statement in my jQuery for the Onclick event.

    Read the article

  • jQuery CSS and .hover() not picking up style

    - by danit
    Im using jQuery to add .hover class to list items. $("#list .item").hover( function () { $(this).addClass("hover"); }, function () { $(this).removeClass("hover"); } ); Then followed by the style in jQuery (I have to supply the style in JS) $('#list .item.hover').css('padding-left', '20px'); The hover class is being applied but the style is not picked up?

    Read the article

  • jQuery - Traversing the DOM

    - by danit
    Here is my HTML: <li> <div class="menu_inner"> <a href="#"> <div class="button"><img class="486" src="images/portalbutton.png" /></div> <div class="prod_description">&nbsp;</div> </a> </div> </li> I want to add a .click() function to .prod_description, the click event should take the background colour applied in CSS from the li element. Using this code: $(".prod_description").mousedown(function() { $('#toolbar').css('background-color', $(this).parent().css('background-color')) }) I dont seem to be able to get the correct $(this).parent() combination....

    Read the article

  • PHP - Get values from Array

    - by danit
    I am trying to get a record from a database using an sql lookup (sql1). This then returns as an array which is fine, but I need to use part of the array for my next stage. $opt=get_records_sql($sql1); //Diags for SQL content print_object($opt); $n = count($opt); if (empty($opt)) { echo 'No options selected'; } else { $optno = $opt["subjectid"]; // Diags of $optno echo '<br>$optno = '.$optno; As you can see, I tried to use this: $opt["subjectid"] as subjectid is the fieldname that I am trying to access and I was under the impression that this was correct for accessing an array, but I get the following error: Notice: Undefined index: subjectid Array contents: Array ( [1] => stdClass Object ( [uname] => JHollands06 [tutor] => M LSt [subjectid] => 1 [year] => 2010 [optid] => 1 ) )

    Read the article

  • Drop down box is always 100%

    - by danit
    I have the following HTML: <div style="30px;"> <table width="100%;"> <tr> <td> <SELECT name="guidelinks"> <OPTION SELECTED value="jex6.htm">Page 1 <OPTION value="jex7.htm">My Cool Page </SELECT> </td> </tr> </table> When this drop down box is displayed the width is 100%, not 30px, can anyone explain why and how to fix this? Unofrtunatly I cant edit the code on the CSS

    Read the article

< Previous Page | 1 2 3