473,753 Members | 8,077 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

clip in Opera

Hello,

I've just downloaded and installed Opera711, good browser. Most of my
scripts work just fine, except the ones that use "clip" property. Opera
docs say that it's supported but I can't get it to work. It seems that
clip is some kind of object (some kind of rect?) but I'm unable to read
it's properties, only
methods. It has only one method "replace". Can you tell me what's going
on there? And why can't I read properties of objects with the function
below?
----------------------------------------
<HTML><HEAD><TI TLE></TITLE>
<script type="text/javascript">
function getClip(o){
var c = o.style.clip;
//document.zz.qq. value = objProps(c, 'o');
//document.zz.qq. value = objProps(o, 'o');
document.zz.qq. value = objProps(o.styl e, 'o');
}
function objProps(obj, name){
var str = "";
for (var i in obj)
str += name + '.' +i+ '=' +obj[i]+ '\n';
return str;
}
function s(){
this.h = "k";
}
</script>
</HEAD><BODY>

<DIV ONCLICK="getCli p(this)"
STYLE="position :absolute; top:0; left:0; width:100; height:50">Get
Clip</DIV>

<FORM NAME="zz" ACTION="" METHOD="">
<TEXTAREA NAME="qq" COLS=65 ROWS=15></TEXTAREA>
</FORM>
</BODY></HTML>
-----------------------------------
TIA,
Roman
Jul 20 '05 #1
2 2000

<roman@nomail > schreef in bericht
news:c4******** *************** *********@4ax.c om...
Hello,

I've just downloaded and installed Opera711, good browser. Most of my
scripts work just fine, except the ones that use "clip" property. Opera
docs say that it's supported but I can't get it to work. It seems that
clip is some kind of object (some kind of rect?) but I'm unable to read
it's properties, only
methods. It has only one method "replace". Can you tell me what's going
on there? And why can't I read properties of objects with the function
below?


There isn't such thing as a default clip property, so you will have to set
it if you want to use it:

function getClip(o){
var c = o.style.clip;
if (c) alert(c); else alert('Not set');
}
....
<DIV ONCLICK="getCli p(this)"
STYLE="position :absolute; top:0; left:0; width:100; height:50;
clip:rect(auto, auto,auto,auto) ">Get
Clip</DIV>
JW

Jul 20 '05 #2
DU
roman@nomail wrote:
Hello,

I've just downloaded and installed Opera711, good browser. Most of my
scripts work just fine, except the ones that use "clip" property. Opera
docs say that it's supported but I can't get it to work.
There are a few bugs. One well known in Opera 7.x is that the background
(image, color) is not clipped, only content.

It seems that clip is some kind of object (some kind of rect?) but I'm unable to read
it's properties, only
methods.
clip is a property. The only shape supported is rect.

It has only one method "replace".

?

Can you tell me what's going on there? And why can't I read properties of objects with the function
below?
----------------------------------------
<HTML><HEAD><TI TLE></TITLE>
<script type="text/javascript">
function getClip(o){
var c = o.style.clip;
//document.zz.qq. value = objProps(c, 'o');
//document.zz.qq. value = objProps(o, 'o');
document.zz.qq. value = objProps(o.styl e, 'o');
Opera 7.20 beta now supports getComputedStyl e and getComputedValu e.
Your getClip function is not best I think. I would have been using
currentStyle for IE instead of style... if you want to get the default
css declarations of existing elements.
}
function objProps(obj, name){
var str = "";
for (var i in obj)
str += name + '.' +i+ '=' +obj[i]+ '\n';
return str;
}
function s(){
this.h = "k";
}
</script>
</HEAD><BODY>

<DIV ONCLICK="getCli p(this)"
STYLE="position :absolute; top:0; left:0; width:100; height:50">Get
Clip</DIV>

Invalid CSS code.
"a unit must be specified for length values"
http://www.w3.org/TR/CSS2/syndata.html#parsing-errors

" The format of a length value (denoted by <length> in this
specification) is an optional sign character ('+' or '-', with '+' being
the default) immediately followed by a <number> (with or without a
decimal point) immediately followed by a unit identifier (e.g., px, deg,
etc.)."
http://www.w3.org/TR/CSS2/syndata.html#value-def-length

Your getClip function should be coded in a way that it should return
rect(auto auto auto auto)
or
rect(auto,auto, auto,auto)
in any DOM2 and CSS2 compliant browser.
<FORM NAME="zz" ACTION="" METHOD="">
<TEXTAREA NAME="qq" COLS=65 ROWS=15></TEXTAREA>


It's always better to quote attribute values as it speeds up a bit
parsing and rendering and it avoids errors of all kinds in all sorts of
situations.

http://www.htmlhelp.com/faq/html/basics.html#quotes
http://www.html-faq.com/htmlvalidation/?quoteattributes
Why attribute values should always be quoted in HTML
http://www.cs.tut.fi/~jkorpela/qattr.html

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/
- Resources, help and tips for Netscape 7.x users and Composer
- Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x
http://www10.brinkster.com/doctorunc...e7Section.html

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
6441
by: Alex NSB | last post by:
Hi all. Consider the following page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML><HEAD><TITLE>Test</TITLE> <STYLE TYPE="text/css"> <!-- #mylayerDiv {position:absolute;left:50px;top:50px;clip:rect(0px, 50px, 50px,
3
2093
by: Roderik | last post by:
Hi, Is it possible to clip a layer (height 5px, width: 780px) to the bottom of the viewport using CSS? regards, Roderik -- http://www.archytas.nl/
0
2152
by: Matt Kruse | last post by:
I'm making changes to an intranet web app that uses only IE6 as the browser. It makes use of CSS expressions for dynamic positioning and other tricks, and it works quite well. My question is: Why can't I get expressions to work as values in a clip definition? This works fine to hide the top half of the table: <table border="1" style="position:absolute;clip:rect(50%,auto,auto,auto);">
15
31808
by: Anand Ganesh | last post by:
HI All, I have an Image. I want to clip a portion of it and copy to another image. How to do this? I know the bounding rectangle to clip. Any suggestions please. Thanks for your time and help. Regards
6
1844
by: queisser | last post by:
Hi all, I'm writing a C# app that uses copy/paste to put graphics in a window. My copy/paste logic first looks for Metafile, then for bitmap. Here's the problem: when I copy and paste a WMF clip from the organizer (in Word or standalone) into my app I get a nice high-res image the first time I copy a particular clip. The second time I get a very low-res copy, presumably the same resolution as the thumbnail. In Word or PowerPoint it...
1
5465
by: Cylix | last post by:
In CSS: clip: px|% px|% px|% px|% How can I set it in javascript? I have tried x.style.clip.top, x.style.clip.left ... However, it seems no effect.
5
5975
cameokid
by: cameokid | last post by:
Can someone help me out with this. Here is what i am trying to do. I have an image of size 310x310. Initially i am displaying only 50x50 using clip property. Later using setTimeout property i am trying to get the entire image so that it looks like animation. But this doesn't happen with the code below <html> <head> <style type="text/css"> .img1 { position:absolute;
29
4093
by: Chris Riesbeck | last post by:
I have an image with a class and the class defines a clip rectangle. In Firefox 2 and 3, and Opera 9, I can access the rectangle with document.defaultView.getComputedStyle(). But that doesn't seem to work in Safari for Windows 3, nor when I use image.currentStyle.clip in IE 7. Is there a way to do this in those browsers? Am I doing something stupid?
0
9072
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9451
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9421
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6869
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6151
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4771
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4942
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2284
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.