Javascript+css realize Flash Dynamic News effect (pp original) _ Image effect

Source: Internet
Author: User
<style type= "TEXT/CSS" >/* Picture news size can change this style/. pp_portal_imgnews {position:relative; Text-align:left; width:250px; height:190px; }. pp_portal_imgnew {position:absolute; /* Picture Style/* pp_portal_imgnew img {width:100%; height:165px; border:0; }/* Text heading style/* Pp_portal_imgnew_title {text-align:center; margin-top:5px; }. pp_portal_imgnew_title a{display:block; Color: #000; Text-decoration:none; font-size:14px; Font-weight:bold; Text-align:center; /* Navigation prompt position/* Pp_portal_navlink {position:absolute; Display:block; right:0px; bottom:5px; /* navigation hint style (not selected)/Pp_portal_navlink a {color: #fff; Text-align:center; Text-decoration:none; }. pp_portal_navlink Li {display:inline; Text-align:center; Background-color: #333; width:15px; margin-left:1px; } </style> <script type= "Text/javascript" > var newsnum = 4; var nn = 1; function Pp_portal_selectpicnew (o) {for (var i=1; i<=newsnum; i++) {var newsId = "Id_pOrtal_imgnew "+ i; if (o==i) {//is selected document.getElementById (newsId). style.display= "Block"; document.getElementById ("Id_portal_navlink" +i). style.background= "Red"; else {document.getElementById (newsId). style.display= "None"; document.getElementById ("Id_portal_navlink" +i). style.background= "#333"; }} nn=o; //Automatically select Picture News function Pp_portal_changepicnew () {if (nn>newsnum) nn=1//alert (NN); Pp_portal_selectpicnew (NN); nn++; function Pp_portal_picnew_auto () {pp_portal_picnew_autotask = SetInterval (' pp_portal_changepicnew () ', 2000); } pp_portal_picnew_auto (); </script> <div id= "id_portal_imgnews" class= "Pp_portal_imgnews" > <div id= "id_portal_imgnew1" class= " Pp_portal_imgnew "> <div class=" pp_portal_imgnew_title "> Photo News one </div> </div> <div id=" Id_porta L_imgnew2 "class=" pp_portal_imgnew "> <div class=" pp_portal_imgnew_title "> Photo News II </div> </div> &L T;div id= "id_portal_imgnew3" class= "Pp_portal_imGnew "> <div class=" pp_portal_imgnew_title "> Photo news three </div> </div> <div id=" ID_PORTAL_IMGNEW4 "cl ass= "Pp_portal_imgnew" > <div class= "pp_portal_imgnew_title" > Photo news four </div> </div> <div id= "id_ Portal_navlinks "class=" Pp_portal_navlink "> <ul> <li id=" Id_portal_navlink1 "> 1 </li> <li id=" Id_portal_navlink2 "> 2 </li> <li id=" Id_portal_navlink3 "> 3 </li> <li id=" Id_portal_navlink4 " > 4 </li> </ul> </div> </div>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.