liferay 轮播图 古城微笑少年丶 2022-05-27 07:22 156阅读 0赞 轮播图模板 #set($interval = $timeInterval__s_.Data) #set($activeIndexValue = $activeIndex.Data) #set ($list = []) #set($Integer = 0) #foreach($imageElement in $No.getSiblings()) #set($url = $imageElement.getChildren().get(0).getData()) #set($imgURL = $imageElement.getChildren().get(0).getChildren().get(0).getData()) #set($position = $imageElement.getChildren().get(0).getChildren().get(1).getData()) #set($color = $imageElement.getChildren().get(0).getChildren().get(2).getData()) #set($headings = $imageElement.getChildren().get(0).getChildren().get(3).getData()) #set($subheadings = $imageElement.getChildren().get(0).getChildren().get(4).getData()) #set($no = $imageElement.getData()) #if($imgURL != "") #set ($tmp = $list.add({"no" : $Integer.parseInt($no), "img" : $imgURL , "url" : $url, "position": $position, "color": $color, "headings": $headings, "subheadings": $subheadings})) #end #end #if ($list.size() == 1) #foreach ($fff in $sortTool.sort($list, 'no:asc')) #if(!$fff.url.contains('http')) <div class="slider-item"> <a href="@layout_set_friendly_url@$fff.url"> <img class = "slider-img" src ="$fff.img"> #if($fff.position == "right") <span class= "slider-text" style = "left:60%;"> #else <span class= "slider-text" style = "left:10%;"> #end <span class="slider-heading" style="color: $fff.color;"> $fff.headings</span></br> <span class="slider-sub-heading" style="color: $fff.color;"> $fff.subheadings</span> </span> </a> </div> #else <div class="slider-item"> <a href="$fff.url" target="_blank"> <img class = "slider-img" src ="$fff.img"> #if($fff.position == "right") <span class= "slider-text" style = "left:60%;"> #else <span class= "slider-text" style = "left:10%;"> #end <span class="slider-heading" style="color: $fff.color;"> $fff.headings</span></br> <span class="slider-sub-heading" style="color: $fff.color;"> $fff.subheadings</span> </span> </a> </div> #end #end #else <ul id="adaptive" class="slider-box"> #foreach ($fff in $sortTool.sort($list, 'no:asc')) <li> <div class="slider-item"> #if(!$fff.url.contains('http')) <a href="@layout_set_friendly_url@$fff.url"> <img class = "slider-img" src ="$fff.img"> #if($fff.position == "right") <span class= "slider-text" style = "left:60%;"> #else <span class= "slider-text" style = "left:10%;"> #end <span class="slider-heading" style="color: $fff.color;"> $fff.headings</span></br> <span class="slider-sub-heading" style="color: $fff.color;"> $fff.subheadings</span> </span> </a> #else <a href="$fff.url" target="_blank"> <img class = "slider-img" src ="$fff.img"> #if($fff.position == "right") <span class= "slider-text" style = "left:60%;"> #else <span class= "slider-text" style = "left:10%;"> #end <span class="slider-heading" style="color: $fff.color;"> $fff.headings</span></br> <span class="slider-sub-heading" style="color: $fff.color;"> $fff.subheadings</span> </span> </a> #end </div> </li> #end </ul> <script> $(document).ready(function() { $('#adaptive').lightSlider({ auto:true, adaptiveHeight:false, item:1, slideMargin:10, loop:true, pause:4000, speed:1000, pauseOnHover:true }); }); </script> #end 轮播图结构 <root available-locales="en_GB" default-locale="en_GB"> <dynamic-element dataType="string" indexType="keyword" name="activeIndex" readOnly="false" repeatable="false" required="false" showLabel="true" type="text" width="small"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[activeIndex]]> </entry> <entry name="predefinedValue"> <![CDATA[0]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <dynamic-element dataType="string" indexType="keyword" name="timeInterval__s_" readOnly="false" repeatable="false" required="false" showLabel="true" type="text" width="small"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[timeInterval (s)]]> </entry> <entry name="predefinedValue"> <![CDATA[2]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <dynamic-element dataType="integer" fieldNamespace="ddm" indexType="" name="No" readOnly="false" repeatable="true" required="true" showLabel="true" type="ddm-integer" width="small"> <dynamic-element dataType="string" indexType="keyword" name="Link_to_page" readOnly="false" repeatable="false" required="false" showLabel="true" type="text" width="small"> <dynamic-element dataType="document-library" fieldNamespace="ddm" indexType="keyword" name="Image" readOnly="false" repeatable="false" required="false" showLabel="true" type="ddm-documentlibrary" width=""> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Image]]> </entry> <entry name="predefinedValue"> <![CDATA[]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <dynamic-element dataType="string" indexType="keyword" multiple="false" name="Position" readOnly="false" repeatable="false" required="false" showLabel="true" type="select" width=""> <dynamic-element name="option11408" type="option" value="none"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[none]]> </entry> </meta-data> <meta-data locale="en_US"> <entry name="label"> <![CDATA[none]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option11409" type="option" value="left"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Left]]> </entry> </meta-data> <meta-data locale="en_US"> <entry name="label"> <![CDATA[Left]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option11410" type="option" value="right"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Right]]> </entry> </meta-data> <meta-data locale="en_US"> <entry name="label"> <![CDATA[Right]]> </entry> </meta-data> </dynamic-element> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Position]]> </entry> <entry name="predefinedValue"> <![CDATA[[""]]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <dynamic-element dataType="string" indexType="keyword" multiple="false" name="Heading_Color" readOnly="false" repeatable="false" required="false" showLabel="true" type="select" width=""> <dynamic-element name="option11669" type="option" value="none"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[None]]> </entry> </meta-data> <meta-data locale="en_US"> <entry name="label"> <![CDATA[None]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option11670" type="option" value="black"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Black]]> </entry> </meta-data> <meta-data locale="en_US"> <entry name="label"> <![CDATA[Black]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option11671" type="option" value="white"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[White]]> </entry> </meta-data> <meta-data locale="en_US"> <entry name="label"> <![CDATA[White]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option7897" type="option" value="#6dad01"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Green]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option7898" type="option" value="red"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Red]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option7899" type="option" value="#0af"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Blue]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option5665" type="option" value="gray"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Gray]]> </entry> </meta-data> </dynamic-element> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Heading Color]]> </entry> <entry name="predefinedValue"> <![CDATA[[""]]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <dynamic-element dataType="string" indexType="keyword" name="Text_On_Banner" readOnly="false" repeatable="false" required="false" showLabel="true" type="textarea" width="small"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Heading]]> </entry> <entry name="predefinedValue"> <![CDATA[]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <dynamic-element dataType="string" indexType="keyword" name="Sub_Heading" readOnly="false" repeatable="false" required="false" showLabel="true" type="textarea" width="small"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Sub Heading]]> </entry> <entry name="predefinedValue"> <![CDATA[]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Link to page]]> </entry> <entry name="predefinedValue"> <![CDATA[]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[No]]> </entry> <entry name="predefinedValue"> <![CDATA[]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> </root> <root available-locales="en_GB" default-locale="en_GB"> <dynamic-element dataType="string" indexType="keyword" name="activeIndex" readOnly="false" repeatable="false" required="false" showLabel="true" type="text" width="small"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[activeIndex]]> </entry> <entry name="predefinedValue"> <![CDATA[0]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <dynamic-element dataType="string" indexType="keyword" name="timeInterval__s_" readOnly="false" repeatable="false" required="false" showLabel="true" type="text" width="small"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[timeInterval (s)]]> </entry> <entry name="predefinedValue"> <![CDATA[2]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <dynamic-element dataType="integer" fieldNamespace="ddm" indexType="" name="No" readOnly="false" repeatable="true" required="true" showLabel="true" type="ddm-integer" width="small"> <dynamic-element dataType="string" indexType="keyword" name="Link_to_page" readOnly="false" repeatable="false" required="false" showLabel="true" type="text" width="small"> <dynamic-element dataType="document-library" fieldNamespace="ddm" indexType="keyword" name="Image" readOnly="false" repeatable="false" required="false" showLabel="true" type="ddm-documentlibrary" width=""> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Image]]> </entry> <entry name="predefinedValue"> <![CDATA[]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <dynamic-element dataType="string" indexType="keyword" multiple="false" name="Position" readOnly="false" repeatable="false" required="false" showLabel="true" type="select" width=""> <dynamic-element name="option11408" type="option" value="none"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[none]]> </entry> </meta-data> <meta-data locale="en_US"> <entry name="label"> <![CDATA[none]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option11409" type="option" value="left"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Left]]> </entry> </meta-data> <meta-data locale="en_US"> <entry name="label"> <![CDATA[Left]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option11410" type="option" value="right"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Right]]> </entry> </meta-data> <meta-data locale="en_US"> <entry name="label"> <![CDATA[Right]]> </entry> </meta-data> </dynamic-element> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Position]]> </entry> <entry name="predefinedValue"> <![CDATA[[""]]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <dynamic-element dataType="string" indexType="keyword" multiple="false" name="Heading_Color" readOnly="false" repeatable="false" required="false" showLabel="true" type="select" width=""> <dynamic-element name="option11669" type="option" value="none"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[None]]> </entry> </meta-data> <meta-data locale="en_US"> <entry name="label"> <![CDATA[None]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option11670" type="option" value="black"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Black]]> </entry> </meta-data> <meta-data locale="en_US"> <entry name="label"> <![CDATA[Black]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option11671" type="option" value="white"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[White]]> </entry> </meta-data> <meta-data locale="en_US"> <entry name="label"> <![CDATA[White]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option7897" type="option" value="#6dad01"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Green]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option7898" type="option" value="red"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Red]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option7899" type="option" value="#0af"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Blue]]> </entry> </meta-data> </dynamic-element> <dynamic-element name="option5665" type="option" value="gray"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Gray]]> </entry> </meta-data> </dynamic-element> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Heading Color]]> </entry> <entry name="predefinedValue"> <![CDATA[[""]]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <dynamic-element dataType="string" indexType="keyword" name="Text_On_Banner" readOnly="false" repeatable="false" required="false" showLabel="true" type="textarea" width="small"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Heading]]> </entry> <entry name="predefinedValue"> <![CDATA[]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <dynamic-element dataType="string" indexType="keyword" name="Sub_Heading" readOnly="false" repeatable="false" required="false" showLabel="true" type="textarea" width="small"> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Sub Heading]]> </entry> <entry name="predefinedValue"> <![CDATA[]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[Link to page]]> </entry> <entry name="predefinedValue"> <![CDATA[]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> <meta-data locale="en_GB"> <entry name="label"> <![CDATA[No]]> </entry> <entry name="predefinedValue"> <![CDATA[]]> </entry> <entry name="tip"> <![CDATA[]]> </entry> </meta-data> </dynamic-element> </root> 轮播图模板 新版 #if (!$entries.isEmpty()) #set ($list = []) #set ($listOne = []) #set ($listTwo = []) #set ($listThree = []) #set ($listFour = []) #foreach ($curEntry in $entries) ##$curEntry.getTitle($locale) #set ($renderer = $curEntry.getAssetRenderer()) #set ($article = $renderer.getArticle()) <input type="hidden" value="$article.getArticleId()"> #set ($document = $saxReaderUtil.read($article.getContentByLocale($locale.toString()))) #set ($no = $document.selectSingleNode("/root/dynamic-element[@name='No']/dynamic-content")) #set ($url = $document.selectSingleNode("/root/dynamic-element[@name='URL']/dynamic-content")) #set ($target = $document.selectSingleNode("/root/dynamic-element[@name='URL_Target']/dynamic-content")) #set( $category = $document.selectSingleNode("/root/dynamic-element[@name='Category']/dynamic-content")) #set( $title = $document.selectSingleNode("/root/dynamic-element[@name='Category_Value']/dynamic-content")) #set ($Integer = 0) #set ($curtitle = $article.getTitle($locale)) #set ($curentitle = $article.getTitle('en_GB')) #set ($urlValue = $url.getText()) #set ($targetValue = $target.getText()) #set ($categoryValue = $category.getText()) #set ($titleValue = $title.getText()) #if( $categoryValue == "One") #set( $listOneTitle = $titleValue) #set ($tmp = $listOne.add({"no" : $Integer.parseInt($no.getText()), "title" :$curtitle , "url" : $urlValue , "target" :$targetValue,"entitle":$curentitle })) #elseif ($categoryValue == "Two") #set( $listTwoTitle = $titleValue) #set ($tmp = $listTwo.add({"no" : $Integer.parseInt($no.getText()), "title" :$curtitle , "url" : $urlValue , "target" :$targetValue,"entitle":$curentitle })) #elseif ($categoryValue == "Three") #set( $listThreeTitle = $titleValue) #set ($tmp = $listThree.add({"no" : $Integer.parseInt($no.getText()), "title" :$curtitle , "url" : $urlValue , "target" :$targetValue,"entitle":$curentitle })) #elseif ($categoryValue == "Four") #set( $listFourTitle = $titleValue) #set ($tmp = $listFour.add({"no" : $Integer.parseInt($no.getText()), "title" :$curtitle , "url" : $urlValue , "target" :$targetValue,"entitle":$curentitle })) #else #end #end <div class = "highlight-links-frame"> #set ($finalListOne = []) #set ($finalListTwo = []) #set ($finalListThree = []) #set ($finalListFour = []) #set ($URLCurrent = "/web" +$themeDisplay.getLayout().getGroup().getFriendlyURL()) #set ($k = 0) #foreach ($fff in $sortTool.sort($listOne, 'no:asc')) #set ($aaa = $finalListOne.add($fff)) #end #foreach ($fff in $sortTool.sort($listTwo, 'no:asc')) #set ($aaa = $finalListTwo.add($fff)) #end #foreach ($fff in $sortTool.sort($listThree, 'no:asc')) #set ($aaa = $finalListThree.add($fff)) #end #foreach ($fff in $sortTool.sort($listFour, 'no:asc')) #set ($aaa = $finalListFour.add($fff)) #end <div class="portlet-column span3"> <div class="bottomlinks-section"> <div class="bottomlinks-title">$listOneTitle</div> #foreach ($obj in $finalListOne) <div class="bottomlinks-links"> #if ($obj.url.contains("http")) <a href="$obj.url" target="$obj.target" id="assetmanager" tracename="$obj.entitle,homepage-box"> $obj.title </a> #elseif ($obj.url.length() == "0") <a target="$obj.target" id="assetmanager" tracename="$obj.entitle,homepage-box"> $obj.title </a> #else <a href="$URLCurrent$obj.url" target="$obj.target" id="assetmanager" tracename="$obj.entitle,homepage-box"> $obj.title </a> #end </div> #end </div> </div> <div class="portlet-column span3"> <div class="bottomlinks-section"> <div class="bottomlinks-title">$listTwoTitle</div> #foreach ($obj in $finalListTwo) <div class="bottomlinks-links"> #if ($obj.url.contains("http")) <a href="$obj.url" target="$obj.target" id="assetmanager" tracename="$obj.entitle,homepage-box"> $obj.title </a> #elseif ($obj.url.length() == "0") <a target="$obj.target" id="assetmanager" tracename="$obj.entitle,homepage-box"> $obj.title </a> #else <a href="$URLCurrent$obj.url" target="$obj.target" id="assetmanager" tracename="$obj.entitle,homepage-box"> $obj.title #end </div> #end </div> </div> <div class="portlet-column span3"> <div class="bottomlinks-section"> <div class="bottomlinks-title">$listThreeTitle</div> #foreach ($obj in $finalListThree) <div class="bottomlinks-links"> #if ($obj.url.contains("http")) <a href="$obj.url" target="$obj.target" id="assetmanager" tracename="$obj.entitle,homepage-box"> $obj.title </a> #elseif ($obj.url.length() == "0") <a target="$obj.target" id="assetmanager" tracename="$obj.entitle,homepage-box"> $obj.title </a> #else <a href="$URLCurrent$obj.url" target="$obj.target" id="assetmanager" tracename="$obj.entitle,homepage-box"> $obj.title </a> #end </div> #end </div> </div> <div class="portlet-column span3"> <div class="bottomlinks-section"> <div class="bottomlinks-title">$listFourTitle</div> #foreach ($obj in $finalListFour) <div class="bottomlinks-links"> #if ($obj.url.contains("http")) <a href="$obj.url" target="$obj.target" id="assetmanager" tracename="$obj.entitle,homepage-box"> $obj.title </a> #elseif ($obj.url.length() == "0") <a target="$obj.target" id="assetmanager" tracename="$obj.entitle,homepage-box"> $obj.title </a> #else <a href="$URLCurrent$obj.url" target="$obj.target" id="assetmanager" tracename="$obj.entitle,homepage-box"> $obj.title </a> #end </div> #end </div> </div> <div style="clear:both"></div> </div> #end
相关 轮播图 ![这里写图片描述][SouthEast] > html页面 <!DOCTYPE html> <html> <head> 布满荆棘的人生/ 2022年06月05日 09:07/ 0 赞/ 369 阅读
相关 轮播图 <html> <head> <meta name="viewport" id="viewport" content="width=device- 布满荆棘的人生/ 2022年05月29日 03:47/ 0 赞/ 295 阅读
相关 轮播图 点击左右按钮,切换图片。图片的序号也随之变化。 逻辑思维:每次点击按钮时,只需要改变img的“src”属性就可以切换图片。将图片的"src"放在数组中,就可以知道每一张图的位 落日映苍穹つ/ 2022年05月27日 08:16/ 0 赞/ 339 阅读
相关 liferay 轮播图 轮播图模板 set($interval = $timeInterval__s_.Data) set($activeIndexValue = $activeI 古城微笑少年丶/ 2022年05月27日 07:22/ 0 赞/ 157 阅读
相关 liferay 轮播图例子 轮播图结构 <root available-locales="zh_CN" default-locale="zh_CN"> <dynamic-element 谁借莪1个温暖的怀抱¢/ 2022年05月27日 07:22/ 0 赞/ 131 阅读
相关 轮播图 废话不多说,直接上代码 <!DOCTYPE html> <html> <head lang="en"> <meta charset=" 淩亂°似流年/ 2022年05月23日 09:38/ 0 赞/ 340 阅读
相关 轮播图 本文转载至菜鸟教程,仅做笔记之用,方便自己学习 [菜鸟链接][Link 1] <!DOCTYPE html> <html> <head> 秒速五厘米/ 2021年12月10日 05:57/ 0 赞/ 529 阅读
相关 轮播图 setInterval setInterval() 方法可按照指定的周期(以毫秒计)来调用函数或计算表达式。 给需要轮播的图片在js里声明一个变量 以数组的类型 在H 男娘i/ 2021年11月17日 06:32/ 0 赞/ 459 阅读
相关 轮播图 方案1 初始化插件: slides是一款基于jQuery无缝轮播图插件,支持图内元素动画,可以自定义动画类型 html代码 <div class="fullS 末蓝、/ 2021年06月10日 20:38/ 0 赞/ 677 阅读
还没有评论,来说两句吧...