Giter Club home page Giter Club logo

jquery-showcase's Introduction

jQuery Showcase

A snazzy little showcase widget, built using jQuery.

Getting started

Download the plugin, and copy the src/showcase folder into your web root.

Add the following code to the <head> of your document:

<link rel="stylesheet" href="showcase/showcase.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script src="showcase/jquery.showcase.js"></script>

You can then place the showcase markup anywhere in your page.

<section id="showcase" style="display: none">
    <ul>
        <li>
            <article>
                <hgroup>
                    <h1>News</h1>
                    <h2>Slide 1 title goes here</h2>
                </hgroup>
                <img src="demo/slide1.jpg" width=640 height=400 alt="Slide 1">
            </article>
        </li>
        <li>
            <article>
                <hgroup>
                    <h1>News</h1>
                    <h2>Slide 2 title goes here</h2>
                </hgroup>
                <img src="demo/slide2.jpg" width=640 height=400 alt="Slide 2">
            </article>
        </li>
        <li>
            <article>
                <hgroup>
                    <h1>News</h1>
                    <h2>Slide 3 title goes here</h2>
                </hgroup>
                <img src="demo/slide3.jpg" width=640 height=400 alt="Slide 3">
            </article>
        </li>
        <li>
            <article>
                <hgroup>
                    <h1>News</h1>
                    <h2>Slide 4 title goes here</h2>
                </hgroup>
                <img src="demo/slide4.jpg" width=640 height=480 alt="Slide 4">
            </article>
        </li>
    </ul>
</section>

<script>
    $("#showcase").showcase();
</script>

What if I want to use XHTML?

Then you're behind the times! Don't worry, there's still an alternative embed code you can use.

<div id="showcase" style="display: none">
    <ul>
        <li>
            <div>
                <div class="title">News</div>
                <div class="subtitle">Slide 1 title goes here</div>
            </div>
            <img src="demo/slide1.jpg" width="640" height="400" alt="Slide 1"/>
        </li>
        <li>
            <div>
                <div class="title">News</div>
                <div class="subtitle">Slide 1 title goes here</div>
            </div>
            <img src="demo/slide2.jpg" width="640" height="400" alt="Slide 2"/>
        </li>
        <li>
            <div>
                <div class="title">News</div>
                <div class="subtitle">Slide 1 title goes here</div>
            </div>
            <img src="demo/slide3.jpg" width="640" height="400" alt="Slide 3"/>
        </li>
        <li>
            <div>
                <div class="title">News</div>
                <div class="subtitle">Slide 1 title goes here</div>
            </div>
            <img src="demo/slide4.jpg" width="640" height="480" alt="Slide 4"/>
        </li>
    </ul>
</div>

<script type="text/javascript">
    $("#showcase").showcase({
        headerSelector: "> div",
        titleSelector: "> div > div.title",
        subtitleSelector: "> div > div.subtitle",
        imageSelector: "> img"
    });
</script>

Configuration options

You can control the behaviour of the plugin with the following options.

  • autoPlay: If true, then the slides will start playing when the page has loaded (default true).
  • duration: The time to spend on each slide before changing to the next (default 5000).

You can control how the plugin interprets the markup of the embed code using the following options.

  • slideSelector: "ul > li"
  • headerSelector: "> article > hgroup"
  • titleSelector: "> article > hgroup > h1"
  • subTitleSelector: "> article > hgroup > h2"
  • imageSelector: "> article > img"

The two example embed codes above already contain the correct markup selectors, so these options are really only for advanced useage.

More information

This project was developed by Dave Hall. You can get the code from the jquery-showcase project site.

Dave Hall is a freelance web developer, based in Cambridge, UK. You can usually find him on the Internet in a number of different places:

jquery-showcase's People

Contributors

etianen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.