Павел
-
Posts
5 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Store
Posts posted by Павел
-
-
Здравствуйте!
Прошу помощи
есть код
<style>
div.block {
padding: 4px;
background: #f00;
}
</style>
<script>
var Opacity =
{
set: function(elem, op)
{
var prop = this.getProperty();
if (!elem || !prop)
return false;
if (prop == 'filter')
{
op *= 100;
var oAlpha = elem.filters['DXImageTransform.Microsoft.alpha'] || elem.filters.alpha;
if (oAlpha)
oAlpha.opacity = op;
else
elem.style.filter += 'progid:DXImageTransform.Microsoft.Alpha(opacity=' + op + ')';
}
else
elem.style[prop] = op;
},
getProperty: function()
{
if (typeof document.body.style.opacity == 'string')
return 'opacity';
else if (typeof document.body.style.MozOpacity == 'string')
return 'MozOpacity';
else if (typeof document.body.style.KhtmlOpacity == 'string')
return 'KhtmlOpacity';
else if (document.body.filters && navigator.appVersion.match(/MSIE ([d.]+);/)[1]>=5.5)
return 'filter';
return '';
}
};
</script>
<div class="block" onclick="Opacity.set(this, 0.3)">Text</div>этот код не работает в IE6/IE7 и отлично работает в FF, Opera, Safari.
Не пойму что происходит..
-
Все, разобрался
оказалось все проще, чем сразу представлялось (как всегда)
тему можно закрывать
Evgeny спасибо за ответы!
-
Идея такая :
$string="param1=text text text;param2=12;param3=433";
$param=explode(";", $string);
$param_one=explode("=",$param[0]);
$$param_one[0]=$param_one[1];
Echo $param1;А остальное доработаете сами ...
да, спасибо! с этим я разобрался. здесь все понятно.
главный вопрос как отличить param1 от param2, если скажем в иходной строке их местами поменять?
нужно что-то типа метода
get_param_name($$param_one[0])
или я что-то туплю?
-
Здравствуйте!
Есть задачка которую пока не могу решит
Есть строка:
param1=text text text;param2=12;param3=433
Мне нужно получить:
$param1=text text text;
$param2=12;
param3=433;причем имен переменных (param1, param2, param3) в исходной строке я не знаю
Прошу помощи
Смена прозрачности
in JavaScript
Posted
Помогло!
Огромное спасибо!