Requirements:
For example, there is the content of each row, when the mouse is put up to show the gray area, when the mouse leaves the gray area disappears
Description
Loop implementation of the line display, the loop body is a div, inside put two Div, with JS to achieve the effect, get to the element, one up each row in the gray area set hidden, add the event $ (". XS"). MouseOver ( function() {$ (this). Children ("div"). CSS ("display"," block");}) ;
Code:
Background
<? PHP include (".. /init.inc.php "); include (".. /dbda.php "); $attr Array ("Zibo Han Enterprise High-quality member enterprises and practical training completion of the project Exchange conference hope that all the trainees prepare for the two sides to submit a satisfactory answer", "answered whether the Austrian accounting law in Anhui played a frame oh on time to reply to the Unit OU I go to pay the Money method good card issuing call fee AH send Cafe Autumn", " Answer whether the Austrian accounting law in Anhui played a good time to reply to the Unit OU I go to pay the way the card issuing call fee AH send Cafe autumn Wind "); $smarty->assign ("Shuzu",$attr); $smarty->display ("test1.html");
Front Desk display:
<Head><Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" /><Scriptsrc=".. /.. /config/jquery-1.11.2.min.js "></Script><title>Untitled Document</title><Scripttype= "Text/javascript">$ (document). Ready (function(e) {$ (". XS"). MouseOver (function(){ $( This). Children ("Div"). CSS ("Display","Block"); }) $(". XS"). Mouseout (function(){ $( This). Children ("Div"). CSS ("Display","None"); })});</Script></Head><Body><{foreach$shuzu as $v}><Divclass= ' xs 'style= ' width:500px;height:30px '> <span><{$v|substr:30: "..."}></span> <Divstyle= ' width:300px;height:100px; margin:0px 0px 0px 300px; Background-color: #CCC; Display:none '><{$v}></Div></Div><{/foreach}></Body></HTML>
Smarty Variable Regulator case