dousi4148 2013-07-28 20:37
浏览 35

too long

I tested this script in normal .php file but when put code in wordpress header file script doesn't worked. Can someone show me how to put CarouFredSel slider inside wordpress theme? Here is the code i used in .php file and all works just fine:

        <!-- include jQuery + carouFredSel plugin -->
    <script type="text/javascript" language="javascript" src="jquery-1.8.2.min.js"></script>
    <script type="text/javascript" language="javascript" src="jquery.carouFredSel-6.2.1-packed.js"></script>

    <!-- optionally include helper plugins -->
    <script type="text/javascript" language="javascript" src="helper-plugins/jquery.mousewheel.min.js"></script>
    <script type="text/javascript" language="javascript" src="helper-plugins/jquery.touchSwipe.min.js"></script>
    <script type="text/javascript" language="javascript" src="helper-plugins/jquery.transit.min.js"></script>
    <script type="text/javascript" language="javascript" src="helper-plugins/jquery.ba-throttle-debounce.min.js"></script>

    <!-- fire plugin onDocumentReady -->
    <script type="text/javascript" language="javascript">
        $(function() {

            //  Basic carousel, no options
            $('#foo0').carouFredSel();

            //  Basic carousel + timer, using CSS-transitions
            $('#foo1').carouFredSel({
                auto: {
                    pauseOnHover: 'resume',
                    progress: '#timer1'
                }
            }, {
                transition: true
            });

            //  Scrolled by user interaction
            $('#foo2').carouFredSel({
                auto: false,
                prev: '#prev2',
                next: '#next2',
                pagination: "#pager2",
                mousewheel: true,
                swipe: {
                    onMouse: true,
                    onTouch: true
                }
            });

            //  Variable number of visible items with variable sizes
            $('#foo3').carouFredSel({
                width: 360,
                height: 'auto',
                prev: '#prev3',
                next: '#next3',
                auto: false
            });

            //  Responsive layout, resizing the items
            $('#foo4').carouFredSel({
                responsive: true,
                width: '100%',
                scroll: 2,
                items: {
                    width: 400,
                //  height: '30%',  //  optionally resize item-height
                    visible: {
                        min: 2,
                        max: 6
                    }
                }
            });

            //  Fuild layout, centering the items
            $('#foo5').carouFredSel({
                width: '100%',
                scroll: 2
            });

        });
    </script>

    <style type="text/css" media="all">

        .list_carousel {
            background-color: #ccc;
            margin: 0 0 30px 60px;
            width: 900px;

        }
        .list_carousel ul {
            margin: 0;
            padding: 0;
            list-style: none;
            display: block;
        }
        .list_carousel li {
            font-size: 40px;
            color: #999;
            text-align: center;
            background-color: #eee;
            border: 5px solid #999;
            width: 400px;
            height: 400px;
            padding: 0;
            margin: 6px;
            display: block;
            float: left;
        }
        .list_carousel.responsive {
            width: auto;
            margin-left: 0;
        }
        .clearfix {
            float: none;
            clear: both;
        }

    </style>

    <p>Basic carousel.</p>
        <div class="list_carousel">
            <ul id="foo1">  
            <?php 
            $html = "";
            $url = "http://rss.dnevnik.hr/index.rss";
            $xml = simplexml_load_file($url);
            for ($i = 0; $i <10; $i++) {
            $title = $xml->channel->item[$i]->title;
            $link = $xml->channel->item[$i]->link; 
            $opis = $xml->channel->item[$i]->description;

            $html .= "<li><div><a href='$link'><h3>$opis<h3></a></div></li>";}
            echo $html;
            ?>
            </ul>


            <div class="clearfix"></div>
        </div>
        <br />
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 php 将rtmp协议转hls协议,无法播放
    • ¥15 miniconda安装不了
    • ¥20 python代码编写
    • ¥20 使用MPI广播数据遇到阻塞
    • ¥15 TinyMCE如何去掉自动弹出的“链接…”工具?
    • ¥15 微信支付转账凭证,如何解决
    • ¥15 在win10下使用指纹登录时,界面上的文字最后一个字产生换行现象
    • ¥20 使用AT89C51微控制器和MAX7219驱动器来实现0到99秒的秒表计数,有开始和暂停以及复位功能,下面有仿真图,请根据仿真图来设计c语言程序
    • ¥15 51单片机 双路ad同步采样
    • ¥15 使用xdocreport 生成word