|
Your time now: Sat Nov 21, 2009 7:05 am
|
View unanswered posts | View active topics
| Author |
Message |
|
zonerdck
|
Post subject: Javascript browser compatability issues. Posted: Thu Jun 18, 2009 6:26 am |
|
Joined: Wed Feb 25, 2009 7:00 am Posts: 2
|
|
Hey I have two small pieces of javascript below right now it only really works in IE. Safari cant handle it neither can chrome among others. I am just wondering why also I have the jquery library and wanted to know if somebody knew how to add a little animation simply. Also right now I just threw it in the body for testing but I am going to put in the head soon. Basically it just resizes a text box and the div containing it. I would also be open to a better solution if anybody knows of one...Thanks.
<script type="text/javascript"> function changeHeight(elemId, h){ var elem = document.getElementById(elemId); elem.style.height = h; } </script>
<script type="text/javascript"> function changeHeight2(elemId, h){ var elem = document.getElementById(elemId); elem.style.height = h; } </script>
<div id='statusinput' style="height:38px;">
<!--<div style="width:60px;float:left;padding-right:5px;"><a href="{$url->url_create('profile',$user->user_info.user_username)}"><img src='{$user->user_photo("./images/nophoto.gif",TRUE)}' class='photo_fr' width='60px' border='0' alt='' /></a></div>-->
<div style="width:442px; float:left; padding:5px 0px 8px 0px;">
<!--<a href="{$url->url_create('profile',$user->user_info.user_username)}">{$user->user_displayname}</a> would like to announce...<br/>-->
<!--input type="textarea" rows='2' onkeypress='return ( (new Event(event)).key=="enter" ? SocialEngine.Viewer.userStatusChangeSubmit() : true );' style="margin: 2px 0px;" size="75" value="" maxlength="100" id="status_new" name="status_new" class="text_small"/-->
<textarea onclick="this.cols=40;this.rows=3; changeHeight('statusinput', 65);" onblur="this.cols=40;this.rows=1; changeHeight2('statusinput', 38);" type="text"name="status_new" cols="40" rows="1" id="status_new" style="overflow: visible; word-wrap: break-word; word-break: normal; scroll:auto; vertical-align:middle; width:100%" onclick="if($('status_new').value=='{if $owner->user_info.user_status}{$owner->user_info.user_status}{else}What would you like to announce?{/if}')$('status_new').select();" onkeyup="countComment()" onmouseup="countComment()">{if $owner->user_info.user_status}{$owner->user_info.user_status}{else}What would you like to announce?{/if}</textarea>
</div>
|
|
| Top |
|
 |
|
rangana
|
Post subject: Re: Javascript browser compatability issues. Posted: Mon Jun 22, 2009 7:40 am |
|
 |
| 500+ Club |
 |
Joined: Wed Feb 27, 2008 6:14 am Posts: 929 Location: Cebu City Philippines
|
|
Try to get Firebug, it will let you know the exact cause of the Error.
Also, I assume that you're running under smarty template right?, You should ensure that you place the script tags under "literal" blocks
Hope that helps.
_________________ ~ Get me some work, I do freelancing ~
|
|
| Top |
|
 |
|
Page 1 of 1
|
[ 2 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 5 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|
|