jQuery changing style of HTML element -


i have list on html

<div id="header" class="row">     <div id="logo" class="col_12">and winner is<span>n't...</span></div>      <div id="navigation" class="row">          <ul id="pirra">             <li><a href="#">why?</a></li>             <li><a href="#">synopsis</a></li>             <li><a href="#">stills/photos</a></li>             <li><a href="#">videos/clips</a></li>             <li><a href="#">quotes</a></li>             <li><a href="#">quiz</a></li>         </ul>     </div>   

it changes fine show horizontally on css change

    div#navigation ul li {          display: inline-block;     } 

but want jquery, use:

    $(document).ready(function() {   console.log('hello');    $('#navigation ul li').css('display': 'inline-block'); }); 

but not working, have wrong style element jquery?

thanks

don't use this:

$('#navigation ul li').css('display': 'inline-block'); 

instead use this:

$('#navigation ul li').css('display', 'inline-block'); 

also, others have stated, if want make multiple css changes @ once, that's when add curly braces (for object notation), , (if wanted change, say, 'background-color' , 'position' in addition 'display'):

$('#navigation ul li').css({'display': 'inline-block', 'background-color': '#fff', 'position': 'relative'}); //the specific css changes after first one, are, of course, examples. 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -