バージョン選択

フォーラム

メニュー

オンライン状況

43 人のユーザが現在オンラインです。 (36 人のユーザが フォーラム を参照しています。)
登録ユーザ: 0
ゲスト: 43
もっと...

サイト内検索

質問 > 管理機能 > 外部パスで画像を登録したいのですが

管理機能

新規スレッドを追加する

フラット表示 前のトピック | 次のトピック
投稿者 スレッド
stella
投稿日時: 2010/9/10 15:34
対応状況: −−−
新米
登録日: 2010/9/3
居住地:
投稿: 6
Re: 外部パスで画像を登録したいのですが
AMUAMU様、seasoft様、ご回答ありがとうございます。

>AMUAMU様
 初心者には難しそうですね。

>seasoft様
 2箇所目の赤文字ですが、<!--{else}-->〜<!--{/if}-->内は拡大画像のためのソースだと考え、前回教えて頂いたソースをそのまま貼り付けてみました。
そんな単純にいくほど甘くはなかったようですね。。。

拡大画像が表示できるよういろいろと奮闘してみたのですが、どうにもうまくいかないため、思考をちょっと変えて詳細ページ内にスワップイメージを設ける事に挑戦してみました。
が、、、

Dreamweaverを使用してtpl内をいじってみましたが結果うまくいきません。。。

<!--▼CONTENTS-->
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<body onload="MM_preloadImages('<img src="<!--{$arrProduct.sub_image1|escape}-->" width="80px" height="80px" alt="<!--{$arrProduct.name|escape}-->" class="picture" />','<img src="<!--{$arrProduct.sub_image2|escape}-->" width="80px" height="80px" alt="<!--{$arrProduct.name|escape}-->" class="picture" />','<img src="<!--{$arrProduct.sub_image3|escape}-->" width="80px" height="80px" alt="<!--{$arrProduct.name|escape}-->" class="picture" />','<img src="<!--{$arrProduct.sub_image4|escape}-->" width="80px" height="80px" alt="<!--{$arrProduct.name|escape}-->" class="picture" />','<img src="<!--{$arrProduct.sub_image5|escape}-->" width="80px" height="80px" alt="<!--{$arrProduct.name|escape}-->" class="picture" />')">

・・・・省略・・・・

<!--★画像★-->
<p>
<img src="<!--{$arrProduct.main_large_image|escape}-->" alt="<!--{$arrProduct.name|escape}-->" name="swap_img" width="280px" height="280px" class="picture" id="swap_img" />
</p>
<p>
▼下の画像をクリックすると上に大きく表示されます▼
</p>

<table>
<tr>
<td width="88"><img src="<!--{$arrProduct.sub_image1|escape}-->" alt="<!--{$arrProduct.name|escape}-->" width="80px" height="80px" class="picture" onclick="MM_swapImage('swap_img','','<img src=!--{$arrProduct.sub_image1|escape}-->" width="80px" height="80px" alt="<!--{$arrProduct.name|escape}-->" class="picture" />',1);MM_swapImgRestore()" /></td>
<td width="88"><img src="<!--{$arrProduct.sub_image2|escape}-->" alt="<!--{$arrProduct.name|escape}-->" width="80px" height="80px" class="picture" onclick="MM_swapImage('swap_img','','<img src="<!--{$arrProduct.sub_image2|escape}-->" width="80px" height="80px" alt="<!--{$arrProduct.name|escape}-->" class="picture" />',1)" /></td>
<td width="89"><img src="<!--{$arrProduct.sub_image3|escape}-->" alt="<!--{$arrProduct.name|escape}-->" width="80px" height="80px" class="picture" onclick="MM_swapImage('swap_img','','<img src="<!--{$arrProduct.sub_image3|escape}-->" width="80px" height="80px" alt="<!--{$arrProduct.name|escape}-->" class="picture" />',1)" /></td>
<td width="89"><img src="<!--{$arrProduct.sub_image4|escape}-->" alt="<!--{$arrProduct.name|escape}-->" width="80px" height="80px" class="picture" onclick="MM_swapImage('swap_img','','<img src="<!--{$arrProduct.sub_image4|escape}-->" width="80px" height="80px" alt="<!--{$arrProduct.name|escape}-->" class="picture" />',1)" /></td>
<td width="89"><img src="<!--{$arrProduct.sub_image5|escape}-->" alt="<!--{$arrProduct.name|escape}-->" width="80px" height="80px" class="picture" onclick="MM_swapImage('swap_img','','<img src="<!--{$arrProduct.sub_image5|escape}-->" width="80px" height="80px" alt="<!--{$arrProduct.name|escape}-->" class="picture" />',1)" /></td>
</tr>

</table>

懲りず、seasoft様に教えて頂いたソースを乱用してます。。。
画像は6枚ともちゃんと表示されるのですが、画像をクリックするとスワップ先の画像が消え <!--{$arrProduct.name|escape}--> という表示がでてきます。
変化自体はするので全く機能してないわけではなさそうなのですが、うまくいきません。
よく見てみると拡大画像のために(恐らく)記述されていたjsが<!--▼CONTENTS-->前に記されていたのに対して、今回のスワップのためのjsは<!--▼CONTENTS-->の直下に記されていました。
一応<!--▼CONTENTS-->前に変更してみましたが変化ありませんでした。
あと、jsの記述の後に<body onload>というbodyタグが記されているのですが、tpl内で使用できるのでしょうか。。

素人目から見て以上の原因候補が見てとれました。

もしスワップイメージをEC-CUBEで使用した経験がある方、解決方法がおわかりになる方がいらっしゃれば是非お知恵を貸して下さい。

乱文失礼いたしました。
フラット表示 前のトピック | 次のトピック


題名 投稿者 日時
   外部パスで画像を登録したいのですが stella 2010/9/3 16:31
     Re: 外部パスで画像を登録したいのですが AMUAMU 2010/9/3 16:58
     Re: 外部パスで画像を登録したいのですが 55eccube 2010/9/3 18:01
     Re: 外部パスで画像を登録したいのですが seasoft 2010/9/4 11:20
     Re: 外部パスで画像を登録したいのですが stella 2010/9/4 14:35
     Re: 外部パスで画像を登録したいのですが stella 2010/9/5 16:01
       Re: 外部パスで画像を登録したいのですが seasoft 2010/9/5 17:42
     Re: 外部パスで画像を登録したいのですが stella 2010/9/7 22:34
       Re: 外部パスで画像を登録したいのですが AMUAMU 2010/9/8 0:51
       Re: 外部パスで画像を登録したいのですが seasoft 2010/9/8 2:51
   » Re: 外部パスで画像を登録したいのですが stella 2010/9/10 15:34
       Re: 外部パスで画像を登録したいのですが a-003 2010/9/11 0:51
         Re: 外部パスで画像を登録したいのですが AMUAMU 2010/9/11 4:07
       Re: 外部パスで画像を登録したいのですが seasoft 2010/9/12 3:02
         Re: 外部パスで画像を登録したいのですが a-003 2010/9/13 0:54
           Re: 外部パスで画像を登録したいのですが seasoft 2010/9/13 0:59
     Re: 外部パスで画像を登録したいのですが stella 2010/9/13 15:49
       Re: 外部パスで画像を登録したいのですが a-003 2010/9/14 14:41
         Re: 外部パスで画像を登録したいのですが a-003 2010/9/14 21:53
           Re: 外部パスで画像を登録したいのですが AMUAMU 2010/9/14 22:30
             Re: 外部パスで画像を登録したいのですが a-003 2010/10/1 0:06

 



ログイン


EC-CUBE公式 Amazon Payプラグイン

統計情報

総メンバー数は89,266名です
総投稿数は110,059件です

投稿数ランキング

1
seasoft
7367
2
468
3217
3
AMUAMU
2712
4
nanasess
2314
5
umebius
2085
6
yuh
1819
7
h_tanaka
1652
8
red
1570
9
mcontact
1299
10
tsuji
958
11
fukap
907
12
shutta
835
13
tao_s
799
14 ramrun 789
15 karin 689
16 sumida 641
17
homan
633
18 DELIGHT 572
19
patapata
502
20
flealog
485


ネットショップの壺

EC-CUBEインテグレートパートナー

Copyright© EC-CUBE CO.,LTD. All Rights Reserved.