Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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:


XML
<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>
Posted

1 solution

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.

XML
<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>


now, use fancy box. Go to the link to use fancy box properly:

http://fancybox.net/howto[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900