php - Should I use Javascript or CSS keyframe animations for a scrolling photo banner? -
i looking advice seasoned web developers. have implemented both css keyframe animation (no javascript), , javascript scrolling photo banners. both banners give me effect want, number of photos scrolling across page continuously. 3 of photos visible @ times while banner scrolls. design calls these photos links other website pages.
there pros , cons both methods, , know approach used , why.
i understand css keyframes not supported in popular browsers until more resent versions. in case, observe users browser , version , display photos statically non keyframe supporting browsers. php's get_browser() function nicely, except have read required browscap.ini file resource intensive. have access php.ini file on hosting server, can alter necessary browscap setting.
javascript on other hand work on many older popular browser versions, unless has been disabled. in js implementation, utilize noscript tags display meesage user site best viewed javascript enabled. seems rather messy. seems me javascript way go, i'd improve way handle disabled javascript. far have been able find out, there no way observe whether or not users browser has javascript disabled.
you need consider first of kind of visitors website attracting. technology blog? charity organization? tech involved websites attract visitors more or less date browser, not high ram computer(a computer high processing memory). next need consider whether bulk of visitors using computer, or if more using mobile or tablet. (and further, if can, discern if visitors utilize browser on another, although discernment seldomly able determined except in rare cases). site review both versions of coding, bulk beingness css or javascript, caniuse.com review browser features far css capability , otherwise. although older browsers include , can utilize javascript (javascript capability seldom disabled, , if believe visitors disabling it, can set note in website, such 'javascript powered' ) not have of functions modern javascript has, check used javascript on same website.
assuming after considering of these things there still no clear answer, consider amount of processing powerfulness each piece of coding (css keyframe vs. javascript animation) takes up. if both sites versions hosted(if they're not, utilize 000webhost.com, free hosting site, utilize testing) can utilize pingdom.com test size , speed of 2 files, can compare better.
javascript php html css
No comments:
Post a Comment