JavaScript Controller

-1

I wanted to associate each session of the images with a link, similar to the one on the gshow site, or I click on the "first image" link to go to the first image session, or it changes alone and the session is selected it is. How to do this?

<head>
    <meta charset="iso-8859-1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="A free portfolio item template for Bootstrap 3 perfect for showcasing a single project. All Start Bootstrap templates are free to download and open source.">

    <title>Portfolio Item - Free Bootstrap Portfolio Template - Start Bootstrap</title>
    <link href="http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!-- Bootstrap Core CSS -->
    <link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">

    <link rel="stylesheet" href="css/responsiveslides.css">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script><scriptsrc="js/responsiveslides.min.js"></script>

    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script><scriptsrc="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .imagem-banner {
            height:150px;
            margin-top: 10px;
        }

        .imagem-banner-destaque {
            height:310px;
            margin-top: 10px;
        }


    </style>

    <script>
        // You can also use "$(window).load(function() {"
        $(function () {

            // Slideshow 1
            $("#slider1").responsiveSlides({
                speed: 700,
            });
        });
    </script>        

</head>

<body>

    <div class="link-slider">
        <ul>
            <li><a href="#link_one">Primeira imagem</a></li>
            <li><a href="#link_two">Segunda imagem</a></li>
        </ul>
    </div>

    <ul id="slider1">
        <li>
            <div class ="container" id="link_one">
                <div class="row">
                    <div class="col-xs-8">
                        <img src="1.jpg" width="100%" class="imagem-banner-destaque" />
                    </div>
                    <div class="col-xs-4">
                        <div class="row">
                            <div class="col-xs-12">
                                <img src="1.jpg" width="100%" class="imagem-banner" />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-12">
                                <img src="1.jpg" width="100%" class="imagem-banner" />
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-4">
                        <img src="1.jpg" width="100%" class="imagem-banner" />
                    </div>
                    <div class="col-xs-4">
                        <img src="1.jpg" width="100%" class="imagem-banner" />
                    </div>
                    <div class="col-xs-4">
                        <img src="1.jpg" width="100%" class="imagem-banner" />
                    </div>
                </div>
            </div>
        </li>
        <li>
            <div class="container" id="link_two">
                <div class="row">
                    <div class="col-xs-8">
                        <img src="2.jpg" width="100%" class="imagem-banner-destaque" />
                    </div>
                    <div class="col-xs-4">
                        <div class="row">
                            <div class="col-xs-12">
                                <img src="2.jpg" width="100%" class="imagem-banner" />
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-xs-12">
                                <img src="2.jpg" width="100%" class="imagem-banner" />
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="col-xs-4">
                        <img src="2.jpg" width="100%" class="imagem-banner" />
                    </div>
                    <div class="col-xs-4">
                        <img src="2.jpg" width="100%" class="imagem-banner" />
                    </div>
                    <div class="col-xs-4">
                        <img src="2.jpg" width="100%" class="imagem-banner" />
                    </div>
                </div>
            </div>
        </li>
    </ul>



</body>

    
asked by anonymous 03.02.2015 / 12:33

1 answer

0

If that's what I understand ... you can work with the onclick attribute of img binding each image to a different page

JS :

   function visualizar(qual){
        switch (qual) {
        case 1: window.open("link1.html",'_blank');
            break;
        case 2: window.open("link2.html",'_blank');
            break;
        case 3: window.open("link3.html",'_blank');
            break;
        case 4: window.open("link4.html",'_blank');
            break;
        case 5: window.open("link5.html",'_blank');
            break;
        case 6: window.open("link6.html",'_blank');
            break;
        case 7: window.open("link7.html",'_blank');
            break;
        case 8: window.open("link8.html",'_blank');
            break;
        default:
            break;
        }
    };

HTML :

<img src="1.jpg" onclick="visualizar(1)"/>
<img src="2.jpg" onclick="visualizar(2)"/>
<img src="3.jpg" onclick="visualizar(3)"/>
<img src="4.jpg" onclick="visualizar(4)"/>
<img src="5.jpg" onclick="visualizar(5)"/>
<img src="6.jpg" onclick="visualizar(6)"/>
<img src="7.jpg" onclick="visualizar(7)"/>
<img src="8.jpg" onclick="visualizar(8)"/>
    
03.02.2015 / 13:25