/    Sign up×
Community /Pin to ProfileBookmark

i am not able to use clip function i am using following code onmouseover of a <td> as soon as i mouse over td nothing happens

function st(){
l1.style.clip=”rect(100px50px50px50)”
}

plz help.
retesh

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@fredmvFeb 09.2004 — Put spaces between the measurement values. Also note your script will only work in IE due to IE polluting the global namespace with all elements given an [font=courier]id[/font] or [font=courier]name[/font] attribute.
Copy linkTweet thisAlerts:
@retesh_gondalauthorFeb 09.2004 — thx for replying fred but unfortunatelu spaces didnt made it work...when is print value of any dimension say top, right or bottoom i get result as "undefined".

plz help.
Copy linkTweet thisAlerts:
@fredmvFeb 09.2004 — Try this:function st()
{
document.getElementById('l1').style.clip = 'rect(100px 50px 50px 50px)';
}
Copy linkTweet thisAlerts:
@retesh_gondalauthorFeb 09.2004 — thx for express replies...but again sam prob...as soon as i mouse over entire layer disappears.
Copy linkTweet thisAlerts:
@fredmvFeb 09.2004 — Have you tried adjusting the measurement values?
Copy linkTweet thisAlerts:
@retesh_gondalauthorFeb 09.2004 — <html>

<script language="javascript">

function st()

{

document.getElementById('l1').style.clip = 'rect(100px 100px 100px 100px)';

fr1.t1.value=l1.style.clip.left;

}

</script>

<body>

<form name="fr1">

<input type="text" name="t1">

<table border="0" bgcolor="red" width="100px">

<tr><td onmouseover="st();">LAYER</td></tr>

</table>

<div id="l1" style="position:absolute; background-color:lightblue; width:300px; height:300px">

<table border="0" width="100px">

<tr><td>aaaaaaaa</td></tr>

<tr><td>bbbbbbbb</td></tr>

</table>

</div>

</form>

</body>


</html>
Copy linkTweet thisAlerts:
@fredmvFeb 09.2004 — Why are you using tables? A form or simple text is not tabular data.
Copy linkTweet thisAlerts:
@retesh_gondalauthorFeb 09.2004 — If i am right area mention in clip function will be visible in layer and rest of the layer area will be hidden. Now i'll be realy greatful if u can help me do the above said task.

I just want to hide some portion of layer onmouseover of a button and on mouseout i should be able to see entire layer again.How can i do this?
×

Success!

Help @retesh_gondal spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...