如何在其他页面中显示新闻的内容,但是在funcybox gallery等相同的页面中? [英] How do I show the content of a news not in other page but in same page like funcybox gallery or something like that?

查看:77
本文介绍了如何在其他页面中显示新闻的内容,但是在funcybox gallery等相同的页面中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想做点什么,但我不知道它是否可能。

我的html中有一些新闻,我不想点击标题然后转到其他页面,我想要单击标题并在同一页面上,只需打开一个包含新闻内容(图像,文本)的窗口。

当我点击链接标题1或标题2时,我想要一个像fancybox一样的窗口或者出现的图像和新闻文本。

这个有可能?如果是,什么是de jquery或其他语言插件呢?



我的HTML代码是这样的:





I want to do something but i dont know if its possible.
I have some news in my html, and i dont want to click in the title and go to other page, i want to click in the title and on the same page, just opens a window with the content of the news (images, text).
When I click in link "title 1" or "title 2" I want that a window like fancybox or something appears with the image and the text of the news.
This is possible? If it is, What is de jquery or other language plugin to do that?

My html code is this:


<section id="news-container">
           <div id="news-body">
               <div id="news-content">
               <h1>News</h1>
               <hr class="line_break">


                 <article id="loop-news">
                   <img src="image1.png" />
                   <a href="#">Title 1</a>
                   <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</p>
                   <h3>Read more</h3>
               </article>


                 <article id="loop-news">
                   <img src="image2.png" />
                   <a href="#">Title 2</a>
                   <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s </p>
                   <h3>Read more</h3>
               </article>



               </div>
          </section>

推荐答案

是否可能。



请使用包含div id的div中的新闻,然后在title标签中输入Id。所有新闻都以同样的方式。然后使用fancybox。



Is it possible.

Please use the news in a div contains a div id, then give the Id in title tag. At the same way all the news. Then use fancybox.

<a id="inline" href="#data">Title 1</a>

<div style="display:none"><div id="data">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s</div>





现在,使用精美的盒子。转到链接以正确使用花式框:



http://fancybox.net/ howto [ ^ ]


这篇关于如何在其他页面中显示新闻的内容,但是在funcybox gallery等相同的页面中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆