i have vertical list in navigation longer screens height. when start hover on list list start in move when mouse around half way down list. any advice on appreciated. thank in advance. one approach, below: var ul = $('ul:first'), ulheight = ul.outerheight(); ul.on('mousemove', function(e){ var win = $(window), cst = win.scrolltop(); if (e.pagey>=(ulheight/2)){ win.scrolltop(cst + 20); } else { win.scrolltop(cst - 20); } });â js fiddle demo . this based upon halfway point of list itself, , therefore relies on halfway point being visible on page itself. to make more functional, ul within containing element, , scrolling based upon being past halfway point of containing element: var div = $('#wrap'), wrapheight = div.height(), listheight = div.find('ul').outerheight(); div.on('mousemove', function(e){ var cpointy = e.pagey, cst = div.scrolltop(); if (cpointy >= (wrapheight/2)) { div.scrolltop(cst + 15); } else { div.scrolltop(cst...
i under impression accessing union member other last 1 set ub, can't seem find solid reference (other answers claiming it's ub without support standard). so, undefined behavior? the confusion c explicitly permits type-punning through union, whereas c++ ( c++11 ) has no such permission. c11 6.5.2.3 structure , union members 95) if member used read contents of union object not same member last used store value in object, appropriate part of object representation of value reinterpreted object representation in new type described in 6.2.6 (a process called ââtype punningââ). might trap representation. the situation c++: c++11 9.5 unions [class.union] in union, @ 1 of non-static data members can active @ time, is, value of @ 1 of non-static data members can stored in union @ time. c++ later has language permitting use of unions containing struct s common initial sequences; doesn't permit type-punning. to determine whether union type-punning is allowe...
Comments
Post a Comment