Ask a Question related to Macromedia Dynamic HTML, Design and Development.
-
Eric Arean #1
Dynamic clip area of a <DIV>
My problem is this one:
I have a cell where i have a divContainer that sets the size and clip area
for the divContent wich contains the database content. I need to make the
height of the clip area equal to the cell height.
You would be asking, why the heck he need this?. Well, i need this because
i have a product detail showing, and i want to show related products, but
the list can be large, and i don't want it to make my page too large, that's
why i want to constrain it inside the div and scroll the products.
I tried 100% in the div css but expand the DIV to the full content, insted
of 100% of the cell height.
Hope i was clear enough and someone knows a way around this.
This is an extract of code i'm using:
***************** Scroll Script *****************
<script type="text/javascript">
<!--
// begin absolutely positioned scrollable area object scripts
function verifyCompatibleBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
return this
}
bw=new verifyCompatibleBrowser()
var speed=75
var loop, timer
function ConstructObject(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.el=bw.dom?document.getElementById(obj):bw.ie4 ?document.all[obj]:bw.ns4?
eval(nest+'document.'+obj):0;
this.css=bw.dom?document.getElementById(obj).style :bw.ie4?document.all[obj].
style:bw.ns4?eval(nest+'document.'+obj):0;
this.scrollHeight=bw.ns4?this.css.document.height: this.el.offsetHeight
this.clipHeight=bw.ns4?this.css.clip.height:this.e l.offsetHeight
this.up=MoveAreaUp;this.down=MoveAreaDown;
this.MoveArea=MoveArea; this.x; this.y;
this.obj = obj + "Object"
eval(this.obj + "=this")
return this
}
function MoveArea(x,y){
this.x=x;this.y=y
this.css.left=this.x
this.css.top=this.y
}
function MoveAreaDown(move){
if(this.y>-this.scrollHeight+objContainer.clipHeight){
this.MoveArea(0,this.y-move)
if(loop) setTimeout(this.obj+".down("+move+")",speed)
}
}
function MoveAreaUp(move){
if(this.y<0){
this.MoveArea(0,this.y-move)
if(loop) setTimeout(this.obj+".up("+move+")",speed)
}
}
function PerformScroll(speed){
if(initialised){
loop=true;
if(speed>0) objScroller.down(speed)
else objScroller.up(speed)
}
}
function CeaseScroll(){
loop=false
if(timer) clearTimeout(timer)
}
var initialised;
function InitialiseScrollableArea(){
objContainer=new ConstructObject('divContainer')
objScroller=new ConstructObject('divContent','divContainer')
objScroller.MoveArea(0,0)
objContainer.css.visibility='visible'
initialised=true;
}
// end absolutely positioned scrollable area object scripts
//-->
</script>
***************** DIV Style *****************
<style type="text/css">
#divContainer{position:relative; width:172px; height:261px; overflow:hidden;
top:261; left:583; clip:rect(0,195,282,0); visibility:visible}
#divContent{position:relative; top:0px; left:0px}
</style>
***************** Content *****************
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><div align="center"><a href="javascript:;" onMouseOut="CeaseScroll()"
onMouseOver="PerformScroll(-10)"><img src="../img/shopcart/uparrow.gif"
alt="Up" width="20" height="10" border="0"></a></div></td>
</tr>
<tr>
<td>
<div id="divContainer" style="z-index: 30; clip: rect(0,172,261,0); top: 0;
left: 0" align="center">
<div id="divContent">
***Database depending content***
</div>
</div>
</td>
</tr>
<tr>
<td height="1"><div align="center"><a href="javascript:;"
onMouseOver="PerformScroll(+10)" onMouseOut="CeaseScroll()"><img
src="../img/shopcart/downarrow.gif" alt="Down" width="20" height="10"
border="0"></a></div></td>
</tr>
</table>
Eric Arean Guest
-
movie clip and dynamic text
i have text loading from xml my text needed to be masked, there for i convert the text field to movie clip but now i cant see the text from the... -
Expandable dynamic text area?
Dear all experienced & less-experience, Does anyone know why a Dynamic Text box/field/area is not expandable? I have a dynamic text area that... -
Dynamic text within a movie clip
I have a movie that has a dynamic text box with a movie clip - the movie clip is on the main timeline. I want to load an external text file into the... -
refering to dynamic movie clip instances
I have been developing a flash movie where movie clips can be dragged to a certain position over another movie clip. When the movie clip is dragged... -
Dynamic text box within dynamic movie clip
I'm having a similar problem. On mine I noticed that although the text doesn't show and the border doesn't show, the cursor changes appropriately...



Reply With Quote

