<! -- FlashRolling focus chartBegin -->
<! --Focus chart start-->
<SCRIPT type = "text/JavaScript">
<! --
VaR focus_width = 330
VaR focus_height = 250
VaR text_height = 25
VaR swf_height = focus_height + text_height
var pics = 'HTTP: // image2.sina.com.cn/ty/u1258p6t29d 1f 20173dt20060118142131.jpg | http://image2.sina.com.cn/ty/U1258P6T29D 1f 3465dt20060118144841.jpg | http://image2.sina.com.cn/ty/U1258P6T29D 1f 3469dt20060118143355.jpg | http://image2.sina.com.cn/ty/U1258P6T29D 1f 63dt20060118143942.jpg '
VaR links = 'HTTP: // sports.sina.com.cn/torino2006/ | http://sports.sina.com.cn/torino2006/ | http://sports.sina.com.cn/go/ 2006-01-18 /14572000884.shtml | http://sports.sina.com.cn/go/ 2006-01-18 /14572000884.shtml'
VaR texts ='The delegation from China to the Turin Winter Olympics was established.|The Chinese Winter Olympics delegation set up Shen Xue, Zhao Hongbo, and shuangjian|World champion Luo Xihe is visiting Sina chat|World champion Luo Xihe is visiting Sina chat'
Document. write ('<object classid = "CLSID: d27cdb6e-ae6d-11cf-96b8-444553540000" codebase = "http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width = "' + focus_width + '" Height = "' + swf_height + '"> ');
Document. write ('<Param name = "allowScriptAccess" value = "samedomain"> <Param name = "movie" value = "http://image2.sina.com.cn/bj/zonghe/pixviewer.swf"> <Param name = "quality" value = "high "> <Param name =" bgcolor "value =" # dadada "> ');
Document. Write ('<Param name = "menu" value = "false"> <Param name = wmode value = "Opaque"> ');
document. write (' ');
Document. write ('<embed src = "http://image2.sina.com.cn/bj/zonghe/pixviewer.swf" wmode = "Opaque" flashvars = "pics =' + pics + '& links =' + Links + '& texts =' + texts + '& borderwidth =' + focus_width + '& borderheight =' + focus_height + '& textheight =' + text_height + '"menu =" false "bgcolor =" # dadada "Quality =" high "width =" '+ focus_width +' "Height =" '+ swf_height +' "allowScriptAccess =" samedomain "type =" application/X-Shockwave-flash "pluginspage =" http://www.macromedia.com/go/getflashplayer "/> ');Document. Write ('</Object> ');
// -->
</SCRIPT>
<! --End of focus chart-->
<! -- FlashRolling focus chartEnd -->
Where:
VaR focus_width = 330
VaR focus_height = 250
VaR text_height = 25
The width, height, and text height of the focus chart
VaR pics =
VaR links =
VaR texts =
It is a statement of the image address, link address, and text description.|Separate
Let's analyze the Fragmentation Processing:
fragments are used to process a piece of content and provide the value to be called, then proceed to the next step. Obviously, we cannot directly connect each item together ( means we cannot automatically process var pics = 'HTTP: // image2.sina.com.cn/ty/u1258p6t29d 1f 20173dt20060118142131.jpg | http://image2.sina.com.cn/ty/U1258P6T29D 1f 3465dt20060118144841.jpg | http://image2.sina.com.cn/ty/U1258P6T29D 1f 3469dt20060118143355.jpg | http://image2.sina.com.cn/ty/U1258P6T29D 1f 63dt20060118143942.jpg ' ) what should we do? Can't it be done?
Of course not. We just need to change the Declaration and value-adding method.
First, we declare that3Variables With a null value:
VaR pics = '';
VaR links = '';
VaR texts = '';
Then we use fragments to loop the following content:
Pics = pics + '[picurl] | ';
Links = links + '[titleurl] | ';
Texts = texts + '[title] | ';
In this way,Pics,Links,TextsAfter splicing, the result isFlashAcceptable normal value
Okay, let's start:
Create a part template with the following content:
Pics = pics + '[picurl] | ';
Links = links + '[titleurl] | ';
Texts = texts + '[title] | ';
Create a part. The part must display the title and image. The image size must be consistent with the size when you call the part. (our system will automatically generate a thumbnail of the size you need, this is also a major advantage of our system)
Then we use the followingCodeCall:
<! -- FlashRolling focus chartBegin -->
<! --Focus chart start-->
<SCRIPT type = "text/JavaScript">
<! --
VaR focus_width = 330;
VaR focus_height = 250;
VaR text_height = 25;
VaR swf_height = focus_height + text_height;
VaR pics = '';
VaR links = '';
VaR texts = '';
[Magic]Your fragments[/Magic]
Links = links. substring (0, links. Length-1 );
Texts = texts. substring (0, texts. Length-1 );
Texts = texts. Replace (New Regexp ("<[^>] *>", "Gi "),"");
Pics = pics. substring (0, pics. Length-1 );
Document. write ('<center> <object classid = "CLSID: d27cdb6e-ae6d-11cf-96b8-444553540000 "codebase =" http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0 "width =" '+ focus_width +' "Height =" '+ swf_height +' "> ');
Document. write ('<Param name = "allowScriptAccess" value = "samedomain"> <Param name = "movie" value = "http://www.jttop.com/images/pixviewer.swf"> <Param name = "quality" value = "high "> <Param name =" bgcolor "value =" # dadada "> ');
Document. Write ('<Param name = "menu" value = "false"> <Param name = wmode value = "Opaque"> ');
document. write (' ');
Document. write ('<embed src = "http://www.jttop.com/images/pixviewer.swf" wmode = "Opaque" flashvars = "pics =' + pics + '& links =' + Links + '& texts =' + texts + '& borderwidth =' + focus_width + '& borderheight =' + focus_height + '& textheight =' + text_height + '"menu =" false "bgcolor =" # dadada "Quality =" high "width =" '+ focus_width +' "Height =" '+ swf_height +' "allowScriptAccess =" samedomain "type =" application/X-Shockwave-flash "pluginspage =" http://www.macromedia.com/go/getflashplayer "/> ');Document. Write ('</Object> </center> ');
// -->
</SCRIPT>
<! --End of focus chart-->
<! -- FlashRolling focus chartEnd -->
You may find the following code:
Links = links. substring (0, links. Length-1 );
Texts = texts. substring (0, texts. Length-1 );
Pics = pics. substring (0, pics. Length-1 );
What is this?
If this section is removed, we can find that the called results cannot be displayed.1234... Check the cause and find that it isLinks,Texts,PicsThe uploaded value has an"|", The above Code is to remove the last one."|"
Is it easy? No action now!
Control download