2009-05-07 26 views
0

ページの途中で、マット付きの画像をフレームするために画像フレームを選択しています。その部分は機能します。私がしたいこと:マットは1マットに設定され、2マットが必要と判断された場合、フレームはFrame8に設定されます。ページがリロードされるとフレーム8をロードする方法を教えてください。今すぐデフォルトのフレームに戻ります。 JqueryとPHPはこのページで使用されています。体内のページリロードに使用する.click jquery変数を設定するにはどうすればよいですか?

$('#mattes-radio-0').click(function() { 
    window.location = 'index-custom.php?mattes=0'; 
    }); 
    $('#mattes-radio-1').click(function() { 
    window.location = 'index-custom.php?mattes=1'; 
    }); 
    $('#mattes-radio-2').click(function() { 
    window.location = 'index-custom.php?mattes=2'; 
    }); 
    $('#mattes-radio-3').click(function() { 
    window.location = 'index-custom.php?mattes=3'; 
    }); 

:ヘッダー内の


JavascriptのVARは、ここでの設定されている私は、クリックされたどのようなフレーム -

$('#frame$frame_id[$i]').click(function() { 
    $('#top-left-frame').html('<img src=\"$upper_left[$i]\" alt=\"\" />'); 
    $('#top-mid-frame').css('background-image','url($upper_middle[$i])'); 
    $('#top-right-frame').html('<img src=\"$upper_right[$i]\" alt=\"\" />'); 
    $('#mid-left-frame').css('background-image','url($middle_left[$i])'); 
    $('#mid-right-frame').css('background-image','url($middle_right[$i])'); 
    $('#bottom-left-frame').html('<img src=\"$bottom_left[$i]\" alt=\"\" />'); 
    $('#bottom-mid-frame').css('background-image','url($bottom_middle[$i])'); 
    $('#bottom-right-frame').html('<img src=\"$bottom_right[$i]\" alt=\"\" />'); 
    $('#frame-select').html('$prod_id'); 
    $('#pid-form').val('$frame_id[$i]'); 
    $('#oa_id-form').val('$prod_id'); 
    var frameState = $(this).attr('id'); 
    alert(frameState + ' was clicked.'); 


}); 


<tr> 
     <td> 
No Mats: <input type="radio" name="mattes-radio" align="middle"<?php if($_GET['mattes'] == 0){ echo 'checked="checked"';} ?> id="mattes-radio-0"> 
     </td> 
     </tr>   
      <tr> 
     <td> 
      Single Mat: <input type="radio" name="mattes-radio" <?php if($_GET['mattes'] == 1){ echo 'checked="checked"';} ?> id="mattes-radio-1"> 
     </td> 
      </tr> 
     <tr> 
<td> 
      Double Mat: <input type="radio" name="mattes-radio" <?php if($_GET['mattes'] == 2){ echo 'checked="checked"';} ?> id="mattes-radio-2"> 
     </td> 
      </tr> 
<tr> 
     <td> 
      Triple Mat: <input type="radio" name="mattes-radio" <?php if($_GET['mattes'] == 3){ echo 'checked="checked"';} ?> id="mattes-radio-3"> 
     </td> 

     </tr> 

答えて

0

クッキーを設定すると、ページの読み込みにそれを読んで、おそらくです最も簡単なオプションです。

+0

私は、フレームがクリックされるたびにCookieを設定/調整します。もしそうなら、それはどのように行われ、どこで良いサイトがそれについて読むのですか? – Kauthon

+0

そうです。 javascriptのクッキーを取得/設定するコードについては、http://f0kin.net/page/tiny-javascript-functions-set-get-cookies/をご覧ください。 –

関連する問題