Posts

css - Can't fade out submenu, with jQuery -

this first question! certanly me on this. i´m working on horizontal menu: html: <div id="menu"> <ul> <li><a href="#">menu 1</a> <ul> <li><a href="#">submenu 1.1</a> <ul> <li><a href="#">submenu 1.1.1</a></li> </ul></li> <li><a href="#">submenu 1.2</a></li> <li><a href="#">submenu 1.3</a></li> </ul></li> <li><a href="#">menu 2</a> <ul> <li><a href="#">submenu 2.1</a> <ul> <li><a href="#">submenu 2.1.1</a></li> </ul></li> </ul></li> <li><a href="#">menu 3</a></li> ...

jquery - how to set slideToggle to work for more than one time -

i have nested ul tags , hide them can apply jquery slidetoggle effect them( want slide each element independently). when press each 'li' tag in first 'ul' second 'ul's become visible together. this how html code is: <div class="content"> <ul class="mainlist"> <li class="mainitem">list item</li> <ul class="sublist"> <li class="subitem">list item</li> <li class="subitem">list item</li> <li class="subitem">list item</li> <li class="subitem">list item</li> <li class="subitem">list item</li> </ul> <li class="mainitem">>list item</li> <ul cl...

Find parent id of product in magento -

here code. $storeid = mage::app()->getstore()->getid(); $session = mage::getsingleton('checkout/session'); foreach($session->getquote()->getallitems() $item) {//how find parent id here} at above mentioned comment want access parent id of particular product. please .. try below code, may you if($item->gettypeid() == "simple"){ $parentids = mage::getmodel('catalog/product_type_grouped')->getparentidsbychild($item->getid()); // check grouped product if(!$parentids) $parentids = mage::getmodel('catalog/product_type_configurable')->getparentidsbychild($item->getid()); //check config product }

javascript - Active or Focus Effect on HTML< Ul> tag -

here sample ul tag: <ul style="list-style-type:none; padding:5px ; border:solid 1px #666666;"> <li>i wating </li> <li>i wating </li> <li>i wating </li> <li>i wating </li> <li>i wating </li> is there way css or javascript set ul border different color when clicked or active ? , when click in different place effect gone . trying make , search not result came out . js fiddle demo: http://jsfiddle.net/saifrahu28/yff6p/ no problem if there jquery solution . building off of fangels answer.... you wouldn't want hard code list style, otherwise have use !important in css. change tabindex ul , add class it. when has focus, change ul:focus item. html <ul tabindex="1" class="thislist" > <li>i wating </li> <li>i wating </li> <li>i wating </li> <li>i wating </li> <li>i wa...

html - SASS extend/share/inherit specific properties from parent to child or vice versa -

is possible extend/share selected/specific properties child parent e.g. without creating variable? .main-container { padding: 20px; margin: 20px; ul { padding:$parentpadding(); margin: 0; } } or vice versa in case, .main-container { ul { rendered .main-container ul { , once parent element ul .main-container can achieve want using purely css solution: inherit ul{ padding: inherit; //will inherit padding value of parent element }

Mysql do not select duplicated values, conditional -

i looking way run simple select statement. have table has 3 columns: id , title , active , active column represents boolean value. 1. foo false 2. foo false 3. foo true 4. bar false 5. bar false 6. aaa false 7. ccc false 8. ccc true i want return following: 4. bar false 5. aaa false this show titles have single active value (this looking for, correct?), , min id title. select min(id) id, title, active yourtable group title having min(active) = max(active)

ruby on rails: controller can't access newly added record -

i'm quite new ror. @ first used sqlite3 database migrated mysql. worked fine application until added record database. i can update new records using "irb" console. have function in controller called python script updates record. here's function: # /dd_bots/update # param name, att def update obj = object.all obj = obj.select{ |o| o.name == params[:name] } obj[0].update_attribute(:att, params[:att]) head :ok end however function doesn't update newly added records returning error: nomethoderror (undefined method update_attribute' nil:nilclass) obviously record doesn't seem found... do have clue why happening? firstly, don't call model object : have disastrous consequences, object base class practically every object in ruby. secondly, update_attribute being called on first element of obj , array. error if array contains no elements, i.e. if there no objects name same name parameter being passed controller. you can ...