Не нравятся результаты поиска? Попробуйте другой поиск!
dle-faq.ru FAQ (все вопросы) Шаблоны (TPL) как выводить шорт стори через скрипт ?

как выводить шорт стори через скрипт ?


     23.01.2016    Шаблоны (TPL), Стили (CSS), jQuery    537

вопрос
здравствуйте. возникла проблема с выводом шорт стори .
хочу выводить шорт стори при нажатии на кнопку инфо
как выводить шорт стори через скрипт ?

вот кнопка
как выводить шорт стори через скрипт ?

вот так должно выводится окно шорт стори
как выводить шорт стори через скрипт ?

и проблема в том что при нажатии на следующий новость выводится всегда первая новость и остальных тоже выводится первая новость почему так ? помогите разобраться я нуб в этом )

а вот сам код


<!--ADD LIST-->    
                        
                               <!--Add List Item-->        
                                <div class="add-list-item">
                                    <div class="add-list-item-cover red">
                                        <a href="#"><img src="{image-1}"  alt=""></a>
                                        <div class="add-list-item-progress"><progress max="13" value="5"></progress><span>Добавлена серия 5/13</span></div>
                                        <div class="corner"><a href='#item-info-popup' class="tooltip-item" title="Информация"><i class="fa fa-info"></i></a></div>
                                        <div class="add-list-item-cover-full"><i class="fa fa-check"></i></div>
                                        <div class="add-list-item-btn-group">
                                            <a href="#" class="add-list-item-btn-like"><i class="fa fa-thumbs-up"></i> Нравится</a>
                                            <a href="#" class="add-list-item-btn-dislike"><i class="fa fa-thumbs-down"></i> Не нравится</a>
                                        </div>
                                    </div>
                                    <div class="add-list-item-info">
                                        <h2 class="add-list-item-info-tags">{link-category}</h2>
                                        <h1 class="add-list-item-info-title"><a href="#">{title limit="30"}</a></h1>
                                    </div>
                                    <div class="add-list-item-bottom">
                                        <ul>
                                            <li class="add-list-item-comments"><a href="">23<p>Комм</p></a></li>
                                            <li class="add-list-item-views"><a href="">35<p>Просм</p></a></li>
                                        </ul>
                                    </div>
                                </div>
                                <!--/Add List Item-->




<!--ITEM INFO-->
                <div id="item-info-popup" class="item-info">
                    <!--item info content-->
                    <div class="item-info-content">
                        <h2><a href="{full-link}" title="">{title}</a></h2>

                        <p>{short-story limit="400"}</p>
                        <!--item info list-->
                        <div class="item-info-content-screen-list">
                            <!--item info list item-->
                            <div class="item-info-content-screen-list-item">
                                <div class="caption">
                                    <div class='item-photobox'>
                                        <a href="{image-2}"><img src="{image-2}" alt="{title}">
                                            <div class="mask">
                                                <div class="info"><i class="fa fa-search-plus"></i></div>
                                            </div>
                                        </a>    
                                    </div>        
                                </div>
                            </div>    
                            <!--/item info list item-->

                            <!--item info list item-->
                            <div class="item-info-content-screen-list-item">
                                <div class="caption">
                                    <div class='item-photobox'>
                                        <a href="{image-3}"><img src="{image-3}" alt="{title}">
                                            <div class="mask">
                                                <div class="info"><i class="fa fa-search-plus"></i></div>
                                            </div>
                                        </a>    
                                    </div>        
                                </div>
                            </div>
                            <!--/item info list item-->

                            <!--item info list item-->
                            <div class="item-info-content-screen-list-item">
                                <div class="caption">
                                    <div class='item-photobox'>
                                        <a href="{image-4}"><img src="{image-4}" alt="{title}">
                                            <div class="mask">
                                                <div class="info"><i class="fa fa-search-plus"></i></div>
                                            </div>
                                        </a>    
                                    </div>        
                                </div>
                            </div>
                            <!--/item info list item-->

                            <!--item info list item-->
                            <div class="item-info-content-screen-list-item">
                                <div class="caption">
                                    <div class='item-photobox'>
                                        <a href="{image-5}"><img src="{image-5}" alt="{title}">
                                            <div class="mask">
                                                <div class="info"><i class="fa fa-search-plus"></i></div>
                                            </div>
                                        </a>    
                                    </div>        
                                </div>
                            </div>
                            <!--/item info list item-->                
                        </div>
                        <!--/item info list-->
                        <span class="close"></span>
                    </div>
                    <!--/item info content-->
                </div>
                <!--/ITEM INFO-->
                         /*----------------
    Item Info
----------------*/
<script>
jQuery(document).ready(function ($) {

    $.fn.expose = function(options) {
        
      var $modal = $(this),
          $trigger = $("a[href=" + this.selector + "]");
      
      $modal.on("expose:open", function() {
        
        $modal.addClass("is-visible");
        $modal.trigger("expose:opened");
      });
      
      $modal.on("expose:close", function() {
        
        $modal.removeClass("is-visible");
        $modal.trigger("expose:closed");
      });
      
      $trigger.on("click", function(e) {
        
        e.preventDefault();
        $modal.trigger("expose:open");
      });
      
      $modal.add( $modal.find(".close") ).on("click", function(e) {
        
        e.preventDefault();
        
        if( e.target !== this )
          return;
        
          $modal.trigger("expose:close");
      });
      
      return;
    }

    $("#item-info-popup").expose();
});

</script>

Ответа пока нет


Чтобы комментировать - войдите или зарегистрируйтесь на сайте

Похожие вопросы