网站首页的Slide

magicman9318 2013-02-09 12:57:18
大家好,小弟最近才开始研究网站的东西,想问问下这里的大大们,
这个网站的Slide是怎么做的呢?我研究了很久,我也在网站找了一些软件,
制造好了后那些Code应该怎么放?放在那里?


...全文
309 6 点赞 打赏 收藏 举报
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
朴人博客 2013-02-22
自然是head
  • 打赏
  • 举报
回复
magicman9318 2013-02-15
还是在“template.html”这里修改? 谢谢
<?xml version="1.0" encoding="UTF-8"?>
<html doctype="XHTML 1.0 Transitional" >
<head>
	<title/>
	<description/>
	<keywords/>
	<googleAnalytics/>
	<theme/>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   	<link rel="shortcut icon" href="/theme/images/asashi.ico"  />
	<link rel="shortcut icon" href="/theme/images/asashicon.png"  />

	<!--template specific functions to initialize:
		1. Currency component
	-->
	<script src="/webshaper/store/0js/template.js" ></script>	

	<script language="javascript" >

	<![CDATA[
	function initPage()
	{	
		var objCol3 = document.getElementById('col3');
		var objCol1 = document.getElementById('col1');
		var objCol2 = document.getElementById('col2');
		
		//if col3 does not exist, AND col2 does not exist then widen col1 
		if(!objCol3 && !objCol2)
		{
			objCol1.style.width = '97%'
		}
		//if either col3 or col2 does not exist
		else if((!objCol3 && objCol2) || 
				(objCol3 && !objCol2) 
				)
		{
			objCol1.style.width = '755px'
		}

		//read the pkCustomer cookie

                var pkCustomer = readCookie('pkCustomer');

      		//capture the enclosing div by ID
		var objDiv = document.getElementById('user'); 

      		//read the customer name from cookie

                custName = new String(readCookie('custName'));

                custName = (custName.replace("+"," ")); 

      		//if customer is logged on

                if(pkCustomer != null && pkCustomer != '')
		{

                	objDiv.innerHTML = '<div class="userText" id="userText" >Welcome <span class="userName">' + custName + '</span></div>' + 
				            '<span class="userLog">' +
					    ' <a href="/webshaper/store/logoff.asp">Logoff</a></span>';

              	}
	}

	]]>
	</script>
	<script src="/theme/js/AC_RunActiveContent.js" type="text/javascript"></script>
	<!--[if lt IE 7]>
	  <script defer type="text/javascript" src="/theme/js/pngfix.js"></script>
	<![endif]-->
	<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="/webshaper/store/index.xml" />
	<script src="/webshaper/includes/clsValidation.js"></script>

</head>
<body onload="initPage();" >
<ws_rootRel/>
<div id="wrapper" >
	<header/>
	<leftbar/>
	<div id="col1">
        <div class="boxWhiteTop"><img src="/theme/images/box-white-top-left.gif" width="10" height="10" /></div>
            <div class="col1Wrapper">
                <content/>
		<div class="clear"></div>
            </div>
        <div class="boxWhiteBot"><img src="/theme/images/box-white-bot-left.gif" width="10" height="15" /></div>
	</div>
    <rightbar/>
	<footer/>
</div>

	<!-- Demo Alert -->
	<!--
	<div class="demoAlert">
	<p>
		This is <a href="http://www.webshaper.com.my/" title="webShaper.com.my" target="_blank">webShaper Stores</a> demo site. <br/><br/>
		Start Your eStore now!<br/></p>
		<p style="padding-top:0;text-align:center"><a href="http://www.webshaper.com.my/pricing.php"> <img style="text-align:center" src="http://www.webshaper.com.my/0img/btn-signupnow-orange.png" border="0" /> </a></p>
		<br/><br/>
		<p style="padding-top:0;"><span style="text-align:left;font-size:10px;">
		All products for showcase only. Best view in
		<a href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx" title="Download Internet Explorer 7" target="_blank">IE7+</a> &amp;
		<a href="http://www.mozilla.com/en-US/firefox/" title="Download Mozilla Firefox" target="_blank">Firefox 3+</a> in 1024 by 768 pixels
		</span>
	</p>
	</div>
	-->
	<!-- Close Demo Alert -->

<statCounter/>
</body>
</html>
  • 打赏
  • 举报
回复
magicman9318 2013-02-15
引用 3 楼 shn11160 的回复:
引用 2 楼 magicman9318 的回复:...这些Code我应该放在哪个文件?应该怎么修改? …… 将代码保存到一个JavaScript文件中,随便取一个名(如:slide.js), 放到名为js的文件夹中,然后,在HTML的head标签内插入下面的代码: <script src="js/slide.js"/>
请问是在“header.html”这文件吗? 我的header.html里面是这样的,请问该怎么修改? 谢谢,感激不尽
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE header
[
														    <!ENTITY nbsp   " ">
                                                            <!ENTITY copy   "©">
                                                            <!ENTITY reg    "®">
                                                            <!ENTITY trade  "™">
                                                            <!ENTITY mdash  "—">
                                                            <!ENTITY ldquo  "“">
                                                            <!ENTITY rdquo  "”">
                                                            <!ENTITY pound  "£">
                                                            <!ENTITY yen    "¥">
                                                            <!ENTITY euro   "€">
]>

<header>

<div id="header">
<div id="headerWrapper">
<div id="companyLogo"><ws_companyLogo/></div>
<div id="banner"></div>
<div class="clear"></div>
</div>
<!-- navMain -->
<div id="topBar">
<div id="topBarLeft"></div>
<div id="navMain">
<ul>
	<li><a href="/index.asp">Home</a></li>
	<li><a href="/webshaper/store/viewCat.asp">Products</a></li>
	<li><a href="/index.asp?p=/static/about.html">About Us</a></li>
	<li><a href="/index.asp?p=/static/contact.html">Contact Us</a></li>
	<!--<li><a href="/index.asp?p=/static/faqs.html">FAQs</a></li>-->
	<li><a href="/index.asp?p=/static/payment.html">How to Make Payment</a></li>
	<li><a href="/webshaper/store/affRegister.asp">Affiliate Registration</a></li>
	<li><a href="/webshaper/store/affLogin.asp">Affiliate Login</a></li>
	<li><a href="http://www.facebook.com/asashiteam" target="_blank"><img src="http://asashionline.com/webshaper/pcm/pictures/00%20-%20WEB/FB.png" width="59" height="18" alt="Find Us On Facebook" /></a></li>

</ul>



</div>


<div id="topBarRight"></div>
<div id="search">
<form name="formSearch" method="post" action="/webshaper/store/searchProd.asp" class="form" onsubmit="this.action = document.forms[0].rootRel.value + '/webshaper/store/searchProd.asp'; return true; " >
<div class="searchBox"><input class="textbox" id="searchText" size="24" name="searchText" value="" onblur="if(this.value=='') this.value='';" onfocus="if(this.value=='Search Product') this.value='';" />
</div><div class="searchBtn"><input type="image" src="/theme/images/btnSearch1.gif" id="btnSearch" /></div><div class="searchBtn2"><a href="/webshaper/store/advancedSearch.asp"><img src="/theme/images/btnSearchAdv.gif" border="0" /></a></div>
<div class="clear"></div>
</form>
</div>
</div>


<div class="clear"></div>
<!-- end navMain -->
<div id="topBar2">
<div id="topBarLeft2"></div>
<div id="user">
<div class="userText">Welcome <span class="userName">Guest</span></div><span class="userLog"><a href="/webshaper/store/sign_in.asp">Sign in</a></span>
</div>
<div id="topBarRight2"></div>
<div id="userCart">
<ul>
    <li><a href="http://www.asashi.com.my" target="_blank"><BLINK><font color="red">Quick Price List</font></BLINK></a></li>
    <li><a href="/index.asp?p=/static/promotions.html">Latest Promotions</a></li>
    <li><a href="/webshaper/store/sign_in.asp">My Account</a></li>
    <li id="odd"><a href="/webshaper/store/viewCart.asp">View Cart</a></li>
    <li><a href="/webshaper/store/registerLogin.asp">Checkout</a></li> 

</ul>
</div>
</div>

<!-- end user login -->

<br/>

<div style="text-align: center;">
<object style="width: 950px; height: 401px;" width="950" height="401" data="/slideshow.swf" type="application/x-shockwave-flash" align="middle">
<param name="data" value="/slideshow.swf" />
<param name="src" value="/slideshow.swf" />
</object>
</div>



</div>


</header>
  • 打赏
  • 举报
回复
云水千寻 2013-02-15
引用 2 楼 magicman9318 的回复:
...这些Code我应该放在哪个文件?应该怎么修改? ……
将代码保存到一个JavaScript文件中,随便取一个名(如:slide.js), 放到名为js的文件夹中,然后,在HTML的head标签内插入下面的代码: <script src="js/slide.js"/>
  • 打赏
  • 举报
回复
magicman9318 2013-02-14
引用 1 楼 jikeytang 的回复:
如果我没有猜错的话是在这个js里边,
https://www.techhypermart.com/skin/frontend/em0006/default/js/em0006.js
JavaScript code?123456789101112131415161718192021222324252627282930313233343536373839404142434……


谢谢大大的回复

这些Code我应该放在哪个文件?应该怎么修改?






这是我们公司刚开始的网站
www.asashionline.com
  • 打赏
  • 举报
回复
豪情 2013-02-09
如果我没有猜错的话是在这个js里边, https://www.techhypermart.com/skin/frontend/em0006/default/js/em0006.js

function decorateSlideshow() {
    var $$li = $$('#slideshow ul li');
    if ($$li.length > 0) {

        // reset UL's width
        var ul = $$('#slideshow ul')[0];
        var w = 0;
        $$li.each(function(li) {
            w += li.getWidth();
        });
        ul.setStyle({
            'width': w + 'px'
        });

        // private variables
        var previous = $$('#slideshow a.previous')[0];
        var next = $$('#slideshow a.next')[0];
        var num = 1;
        var width = ul.down()
            .getWidth() * num;
        var slidePeriod = 3; // seconds
        var manualSliding = false;

        // next slide
        function nextSlide() {
            new Effect.Move(ul, {
                x: -width,
                mode: 'relative',
                queue: 'end',
                duration: 1.0,
                //transition: Effect.Transitions.sinoidal,
                afterFinish: function() {
                    for (var i = 0; i < num; i++)
                    ul.insert({
                        bottom: ul.down()
                    });
                    ul.setStyle('left:0');
                }
            });
        }

        // previous slide
        function previousSlide() {
            new Effect.Move(ul, {
                x: width,
                mode: 'relative',
                queue: 'end',
                duration: 1.0,
                //transition: Effect.Transitions.sinoidal,
                beforeSetup: function() {
                    for (var i = 0; i < num; i++)
                    ul.insert({
                        top: ul.down('li:last-child')
                    });
                    ul.setStyle({
                        'position': 'relative',
                        'left': -width + 'px'
                    });
                }
            });
        }

        function startSliding() {
            sliding = true;
        }

        function stopSliding() {
            sliding = false;
        }

        // bind next button's onlick event
        next.observe('click', function(event) {
            Event.stop(event);
            manualSliding = true;
            nextSlide();
        });

        // bind previous button's onclick event
        previous.observe('click', function(event) {
            Event.stop(event);
            manualSliding = true;
            previousSlide();
        });


        // auto run slideshow
        new PeriodicalExecuter(function() {
            if (!manualSliding) previousSlide();
            manualSliding = false;
        }, slidePeriod);


    }
}
也没必要完全用他的,可以找一个jq的插件。这个的复用性还是个问题。
  • 打赏
  • 举报
回复
相关推荐
发帖
CSS
加入

6.0w+

社区成员

层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
申请成为版主
帖子事件
创建了帖子
2013-02-09 12:57
社区公告
暂无公告