Единый форум поддержки

Информация о пользователе

Привет, Гость! Войдите или зарегистрируйтесь.


Вы здесь » Единый форум поддержки » Корзина » опять два скрипта враждуют!


опять два скрипта враждуют!

Сообщений 1 страница 6 из 6

1

скрипт на доп. цвета и скрипт на доп. смайлы.. почему то кнопы в обоих открывают только смайлы..
это на цвета:

Код:
<style>
#custom-mycolor {background-image:url('http://s60.radikal.ru/i168/0903/65/de67e22761d8.jpg'); padding:0; line-height:0; background-position:center; background-repeat:no-repeat; height:26px; width:100%}
</style>
<script type="text/javascript">
if((form=document.getElementById("form-buttons")))
form.getElementsByTagName("tr")[0].insertCell(19).innerHTML="<img src='/i/blank.gif' title='Мои цвета' id='custom-mycolor'  title='Мои цвета' onclick=\"return changeVisibility('mycolor', this);\" />"
</script>
<div class="container" id="mycolor" style="display:none; width:807px">
	<table cellspacing="0">
<tr>
<td style="background-color:Yellow" Height="20px" onclick="bbcode('[color=Yellow]', '[/color]'); return changeVisibility('mycolor', this)"></td>
<td style="background-color:Gold" onclick="bbcode('[color=Gold]', '[/color]'); return changeVisibility('mycolor', this)"></td>
<td style="background-color:Orange" onclick="bbcode('[color=Orange]', '[/color]'); return changeVisibility('mycolor', this)"></td>
<td style="background-color:Chocolate" onclick="bbcode('[color=Chocolate]', '[/color]'); return changeVisibility('mycolor', this)"></td>

</tr>
</table>
</div>

это на смайлы:

Код:
<center>
<table><tr>
<td onclick="return changeVisibility('mycolor', this)"><img src="http://s44.radikal.ru/i105/0911/05/586f37b37506.gif" alt="Дополнительные смайлы" /></td></tr></table>
<div class="container" id="mycolor" style="display:none; width: 800px">
<table cellspacing="0">
<tr>
<td>
<center>
<a title="1" href="javascript:void(0); return false;" 
onclick="bbcode('[img]' + this.firstChild.src + '[/img]', ''); return false;"><img border="0" 
src="http://i003.radikal.ru/0910/7c/e765a4fd183a.gif"/></a>
<a title="2" href="javascript:void(0); return false;" 
onclick="bbcode('[img]' + this.firstChild.src + '[/img]', ''); return false;"><img border="0" 
src="http://s44.radikal.ru/i105/0910/5d/771473037c20.gif"/></a>
<a title="3" href="javascript:void(0); return false;" 
onclick="bbcode('[img]' + this.firstChild.src + '[/img]', ''); return false;"><img border="0" 
src="http://s52.radikal.ru/i135/0910/8d/da812a73cedd.gif"/></a>

</center>
</td>
</tr>
</table>
</div>
</center>

как их разделить??

Отредактировано АЛЬБ (Вт, 10 Ноя 2009 00:43:55)

0

2

АЛЬБ написал(а):

как их разделить??

Ты где откопал этот скрипт на смайлы?
Могу предложить другой

Код:
<div>
<input type="Button" value="Дополнительные смайлы" onclick="return showhide(this)">
<p style="display:none">
<img src="адрес смайла" style="cursor:pointer"onclick="smile('[img]адрес этого же смайла[/img]')"/>
<img src="адрес смайла" style="cursor:pointer"onclick="smile('[img]адрес этого же смайла[/img]')"/>
<img src="адрес смайла" style="cursor:pointer"onclick="smile('[img]адрес этого же смайла[/img]')"/>
<img src="адрес смайла" style="cursor:pointer"onclick="smile('[img]адрес этого же смайла[/img]')"/>
</div>
<script>
function showhide(b){
p = b.parentNode.getElementsByTagName("p")[0]
if(b.value=="Дополнительные смайлы"){
b.value="Скрыть смайлы"
p.style.display="block"}
else{
b.value="Дополнительные смайлы"
p.style.display="none"}
return false}
</script>

0

3

Good написал(а):

Ты где откопал этот скрипт на смайлы?

мне его расположение понравилось.. :D  и он рабочий!
у твоего где кнопа будет?

0

4

АЛЬБ написал(а):

у твоего где кнопа будет?

под формой ответа

0

5

АЛЬБ
У тебя у обоиз скриптов прописан один и тот же идентификатор. А поскольку это не один и тот же элемент, то получилось так, что открывалось то, что стоит первым.
Сейчас попробуй так:

Код:
<style>
#custom-mycolor {background-image:url('http://s60.radikal.ru/i168/0903/65/de67e22761d8.jpg'); padding:0; line-height:0; background-position:center; background-repeat:no-repeat; height:26px; width:100%}
</style>
<script type="text/javascript">
if((form=document.getElementById("form-buttons")))
form.getElementsByTagName("tr")[0].insertCell(19).innerHTML="<img src='/i/blank.gif' title='Мои цвета' id='custom-mycolor'  title='Мои цвета' onclick=\"return changeVisibility('mycolor', this);\" />"
</script>
<div class="container" id="mycolor" style="display:none; width:807px">
	<table cellspacing="0">
<tr>
<td style="background-color:Yellow" Height="20px" onclick="bbcode('[color=Yellow]', '[/color]'); return changeVisibility('mycolor', this)"></td>
<td style="background-color:Gold" onclick="bbcode('[color=Gold]', '[/color]'); return changeVisibility('mycolor', this)"></td>
<td style="background-color:Orange" onclick="bbcode('[color=Orange]', '[/color]'); return changeVisibility('mycolor', this)"></td>
<td style="background-color:Chocolate" onclick="bbcode('[color=Chocolate]', '[/color]'); return changeVisibility('mycolor', this)"></td>

</tr>
</table>
</div>
<center>
<table><tr>
<td onclick="return changeVisibility('mysmiles', this)"><img src="http://s44.radikal.ru/i105/0911/05/586f37b37506.gif" alt="Дополнительные смайлы" /></td></tr></table>
<div class="container" id="mysmiles" style="display:none; width: 800px">
<table cellspacing="0">
<tr>
<td>
<center>
<a title="1" href="javascript:void(0); return false;" 
onclick="bbcode('[img]' + this.firstChild.src + '[/img]', ''); return false;"><img border="0" 
src="http://i003.radikal.ru/0910/7c/e765a4fd183a.gif"/></a>
<a title="2" href="javascript:void(0); return false;" 
onclick="bbcode('[img]' + this.firstChild.src + '[/img]', ''); return false;"><img border="0" 
src="http://s44.radikal.ru/i105/0910/5d/771473037c20.gif"/></a>
<a title="3" href="javascript:void(0); return false;" 
onclick="bbcode('[img]' + this.firstChild.src + '[/img]', ''); return false;"><img border="0" 
src="http://s52.radikal.ru/i135/0910/8d/da812a73cedd.gif"/></a>

</center>
</td>
</tr>
</table>
</div>
</center>

+1

6

rps спасибо.. я уже разобрался..

0


Вы здесь » Единый форум поддержки » Корзина » опять два скрипта враждуют!