PHP development framework Yii Framework tutorial (39) Zii component-Slider example

黄舟
Release: 2023-03-05 09:32:01
Original
1229 people have browsed it

CJuiSlider displays a slider that can be used to zoom images or use other functions. It encapsulates the JUI slider plug-in.

This example uses CJuiSlider to scale an image:

<?php $this->widget(&#39;zii.widgets.jui.CJuiSlider&#39;, array(  
    &#39;value&#39;=>50,  
    &#39;options&#39;=>array(  
                &#39;min&#39;=>1,  
                &#39;max&#39;=>100,  
                &#39;slide&#39;=>&#39;js:  
            function(event,ui){  
                $("#image").width(648*ui.value/100);  
                $("#zoom").text(ui.value+"%");  
            }  
        &#39;,  
                ),  
            &#39;htmlOptions&#39;=>array(  
                &#39;style&#39;=>&#39;width:648px; float:left;&#39;  
                ),  
)); ?>  
  
<div id="zoom" >50%</div>  
<br />  
  
<img  id="image"    style="max-width:90%" src="images/harry.jpg" alt="PHP development framework Yii Framework tutorial (39) Zii component-Slider example" >
Copy after login
Copy after login
<?php $this->widget(&#39;zii.widgets.jui.CJuiSlider&#39;, array(  
    &#39;value&#39;=>50,  
    &#39;options&#39;=>array(  
                &#39;min&#39;=>1,  
                &#39;max&#39;=>100,  
                &#39;slide&#39;=>&#39;js:  
            function(event,ui){  
                $("#image").width(648*ui.value/100);  
                $("#zoom").text(ui.value+"%");  
            }  
        &#39;,  
                ),  
            &#39;htmlOptions&#39;=>array(  
                &#39;style&#39;=>&#39;width:648px; float:left;&#39;  
                ),  
)); ?>  
  
<div id="zoom" >50%</div>  
<br />  
  
<img  id="image"    style="max-width:90%" src="images/harry.jpg" alt="PHP development framework Yii Framework tutorial (39) Zii component-Slider example" >
Copy after login
Copy after login

PHP development framework Yii Framework tutorial (39) Zii component-Slider example

The above is the content of the PHP development framework Yii Framework tutorial (39) Zii component-Slider example , for more related content, please pay attention to the PHP Chinese website (www.php.cn)!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template