Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _News() {
- //Hash for the URL and Onload Event
- var hash = window.location.hash.substr(1);
- var href = $('.news-list-item a').each(function(){
- var href = $(this).attr('href');
- if(hash==href){
- alert ('success');
- var toLoad = hash+'#col6 .news-single-item';
- }
- else{
- alert ('error');
- //var toLoad = $('.news-list-item a:first').attr('href')+'#col6 .news-single-item';
- }
- $('#col8').addClass('loading');
- $('#col8 p').fadeOut('fast');
- showContent(toLoad);
- });
- //Onclick get the Content
- /*
- $('.news-list-item a').click(function() {
- var toLoad = $(this).attr('href')+'#col6 .news-single-item';
- $('#col8').addClass('loading');
- $('#col8 p').fadeOut('fast');
- window.location.hash = $(this).attr('href');
- showContent(toLoad);
- return false;
- });
- */
- //Show Content
- function showContent(toLoad) {
- $('.news-single-item').remove();
- $("<div class='news-single-item'></div>").css('display','none').appendTo('#col8');
- $('.news-single-item').load(toLoad,function() {
- $('#col8').removeClass('loading');
- $('.news-single-item').fadeIn('slow');
- });
- }
- }
Add Comment
Please, Sign In to add comment