2012-01-11 8 views
0

ajaxでimgコンテンツを読み込むことは誰も助けてくれませんか?jquery;画像;再ロード

<script type="text/javascript"> 

jQuery(function($){ 
$('.bar2').mosaic({ 
animation:'slide'//fade or slide 
}); 
}); 

<script type="text/javascript"> 
    $(document).ready(function() {     
    var hash = window.location.hash.substr(1); 
    var href = $('#leftNav li a').each(function(){ 
    var href = $(this).attr('href'); 
    if(hash==href.substr(0,href.length-4)){ 
     var toLoad = hash+'.php #contentProd'; 
     $('#contentProd').load(toLoad) 
}           
}); 
    $('#leftNav li a').click(function(){       
var toLoad = $(this).attr('href')+' #contentProd'; 
    $('#contentProd').hide('fast',loadContent); 
    $('#load').remove(); 
    $('#wrapper').append('<span id="load">LOADING...</span>'); 

function loadContent() { 
    $('#contentProd').load(toLoad,'',showNewContent()) 
} 
function showNewContent() { 
    $('#contentProd').show('normal',hideLoader()); 
} 
function hideLoader() { 
    $('#load').fadeOut('normal'); 
} 
return false; 
}); 
}); 
    $('#leftNav li a').click(function() { 
    $('#leftNav li a').removeClass('active'); 
    $(this).addClass('active'); 
}) 
</script> 

HTML

<div class="body3"> 
    <div class="main"> 
    <article id="content"> 
     <div class="wrapperProd" > 

     <section class="col5"> 
     <div id="contentProd"> 
     <section class="cols pad_left0"> 
     <div class="wrapper pad_bot2"> 
    <h5>16 CUBE</h5> 
      <figure> 
       <div class="mosaic-block bar2"><a href="onePage.php" class="mosaic-overlay"> 
       <div class="details"> 
        <p style="color:#FFF">SOME TEXT*<br /> 
       </div> 
       </a> 
       <div class="mosaic-backdrop"><a href="16.php"> 
       <img src="../../images/pres.jpg" alt="" width="" height="" /> 


       </a></div> 
       </div> 
      </figure> 
      <a href="16.php" class="small button green" style="position:relative; top:22px;">More</a> </div> 
     </section> 
</div> 
</article> 
</div> 
</div> 

は、私が 'アクティブ' のようなremoveClass/IDを作ることはできますか? :§

MAny tksは事前に返信してください!

KR

p.s.このクエストのようなものは見つからなかったので、今日登録しました:)

/////////// EDIT

お返事のためのTKS、

I'veが行われ、両方の接合部、

内部

http://buildinternet.com/project/mosaic/

http://net.tutsplus.com/tutorials/javascript-ajax/how-to-load-in-and-animate-content-with-jquery/

ローカルホストで直接表示すると表示され、動作しますが、モザイク画像のコンテンツが他のメニューに置き換えられた場合、再びモザイク画像で移動すると表示されませんでした。 jquertで

TY

+3

はStackOverflowのへようこそこの

BRを勉強したいしてください。あなたは本当にあなたの質問を明確にする必要があります。何が効いていないのですか?実際の例ではどのような結果になるでしょうか? – maxedison

+0

Quest編集、tks again maxedison – rikardo

+0

あなたが何を求めているのかまだ分かりません。そして、追加の質問/編集として回答を投稿しないでください。 – maxedison

答えて

0

- 私は非常に新しい、plase私は、.bar2

<script type="text/javascript"> 
$(document).ready(function() {     
var hash = window.location.hash.substr(1); 
var href = $('#leftNav li a').each(function(){ 
    var href = $(this).attr('href'); 
    if(hash==href.substr(0,href.length-4)){ 
     var toLoad = hash+'.php #contentProd'; 
     $('#contentProd').load(toLoad) 
    }       
}); 
$('#leftNav li a').click(function(){       
    var toLoad = $(this).attr('href')+' #contentProd'; 
    $('#contentProd').hide('fast',loadContent); 
    $('#load').remove();  
    function loadContent() { 
     $('#contentProd').load(toLoad,'',showNewContent()) 
    } 
    function showNewContent() { 
     $('#contentProd').show('normal',hideLoader()); 
    } 
    function hideLoader() { 
     $('#load').fadeOut('normal'); 
    } 
    return false; 
}); 
}); 
$('#leftNav li a').click(function() { 
$('#leftNav li a').removeClass('active'); 
$(this).addClass('active'); 
}) 
jQuery(function($){ 

$('.bar2').mosaic({ animation: 'slide'//fade or slide 
}); 
}); 
</script> 

I'veが行われ、両方の接合呼び出す強制することができます方法を理解する必要があり

http://buildinternet.com/project/mosaic/

ajaxコンテンツの内部、

basacly、モザイクは4つすべてから1つのメニューバーにしか表示されませんが、問題は、そのメニューを直接ロードすると画像が表示され、画像メニューを一度ナビゲートすれば、登場する!

画像が要求されるときに.bar2を呼び出す方法はありますか。

私は

function loadContent() { 
     $('#contentProd', '.bar2').load(toLoad,'',showNewContent()) 
    } 

画像が常に要求されますが、彼らは唯一のimageMenuに要求されるべきで「.bar2' 、

条件がソリューションです置けば?

すべて

関連する問題