Adjusting CFWindow position on the screen, is it possible? - coldfusion-10

I try to use cfwindow to deliver an error/warning message to my users. It works but the only problem is the pop up window is off the screen all the way to the bottom sinking to the task bar.
I thought I can use the x and y attributes but I tried them and they did not work.
Is it possible to adjust the positioning of cfwindow at all so when it shows up it will be in the middle of the screen or at least in the middle up instead of sinking down below?
<CFTRY>
<cffile action="upload" filefield="uploadfile" destination="#TempDestination#" nameConflict="overwrite" result="myupload">
<cfdump var="#myupload#">
<CFCATCH type="Any">
<cfwindow initShow="true" title="Minute Upload Problem" center="true" height="200" width="400"
x="880" y="850"
bodyStyle="font-family: verdana; color: ##000000; font-size: 13;"
headerStyle="font-family: verdana; background-color: ##ff0000; color: ##ffffff"
resizable="False" name="NoPermission">
<!--- message --->
<div align="center">
Destination Folder may not be set to accept your file<br>
Please contact the webmaster.
</div>
</cfwindow>
</CFCATCH>
</CFTRY>

To fit the window as per x & y coordinates, you will have to set
center="false"
If center is set to true, then it will take precedence over the x & y coordinates. I have set center="false". Now, the position of the new popup windows changes, as I change the x & y coordinates.

Related

How can I offset a MUI Popover component from an anchorEl?

With anchorOrigin, I can give a MUI Popover an offset with anchorPosition.top and anchorPosition.left. But this has no effect when I'm using an anchorEl (i.e., attaching the popover to a trigger element), not an anchorOrigin (i.e., using absolute positioning).
It seems I can do this with the MUI Popper
(see this issue), but not very easily with the popover. I want the clickaway functionality so apart from this positioning difficulty I prefer the popover.
What's the best way to attach to an element but shift the popover (say, down and right)?
You can just pass a number to the horizontal and vertical properties to have them offset with respect to the top-left corner of the anchor element, like this:
<Popover
id={id}
open={open}
anchorEl={anchorEl}
onClose={handleClose}
anchorOrigin={{
vertical: 'bottom',
horizontal: 100,
}}
>
<Typography sx={{ p: 2 }}>The content of the Popover.</Typography>
</Popover>
this will open the popover 100 pixels to the right of the left margin of the anchorEl.

TYPO3 Fluid: f:image trim image then scale

I have a square image of 1200x1200px. Now I want to cut off / trim all sides by 80px and then scale it down to 275px. How is this possible?
<f:image src="path/to/image.jpg" width="275c" />
This just scales down the image, so I took a look at the imgResource Core Documentation that told me, you can crop images by substracting x percent.
<f:image src="path/to/image.jpg" width="1120c-93" height="1120c-93" />
93% of 1200px are roughly 1120px.
Next try was to first crop, then scale, but it seems that I'm not able to trim a square image at all.
<f:image src="{f:uri.image(src: 'path/to/image.jpg', width: '1200c-93')}" width="275" />
Does anyone have any suggestions how to solve the problem?
Edit
So I tried the following with fixed width and height:
<f:image src="{f:uri.image(src: '{item.imagePath}image_001.jpg', width: '1120c-50', height: '1120c-50')}" width="275" height="275" alt="{item.name}" />
<f:image src="{item.imagePath}image_001.jpg" alt="{item.name}" width="275" alt="{item.name}" />
But this gives me two identical images: http://img545.imageshack.us/img545/204/nsuo.png
You have to specify an explicit height in the inner call and the crop values must be smaller than the original image size. So try this one:
<f:image src="{f:uri.image(src: 'path/to/image.jpg', width: '1120c-93', height: '1120c-93')}" width="275" alt="" />

Opacity toggle three (or more) DIV

<div id="rotator">
<p id="1">Some Text 1</p>
<p id="1">Some Text 2</p>
<p id="1">Some Text 3</p>
</div>
They are presented in a row. All I want is automatically cycle the three text by toggling opacity, ie. at first text 1 is opacity 1, and test 2 and 3 are opacity .5. Then after 5 seconds or so, text 2 is opacity 1, and text 1 and three are opacity .5... so on in a cycle.
Can someone give me a hint/direction on how to do this in jquery please. Thank you in advance.

Dojox Datagrid, add span to every cell to make css nowrap to work in IE7

Since nowrap on td element doesn't seems to work in IE, see this question, I am in desperate need of help how to add a span element with nowrap to every cell in a Dojox Datagrid without having to define field formatters to accomplish this.
See jsfiddle here http://jsfiddle.net/HkxHZ/4/
Using this css I get what I want in Chrome and FF, i.e. no word wrap and overflow hidden. But it doesn't work in IE..
<style type="text/css">
.dojoxGridRowTable {
table-layout: fixed;
width: 0px;}
.dojoxGrid .dojoxGridCell {
text-align: left;
overflow:hidden;
white-space:nowrap;}
</style>​
This method is like auto-size in that is will make the width of each column in the DataGrid big enough to show your data with no wrapping.
What you should do is calculate the proper width for each column of the grid layout based on PX size of the text in the column description and data for that column. This should be done before creating the grid layout.
Here is how you get the proper width in px. Add the following html to your page:
css:
#test
{
position: absolute;
visibility: hidden;
height: auto;
width: auto;
}
<div id="test"></div>
1) Get the font size used in your DataGrid
2) Get the div object and set the font size to what is used in the grid
<div id="test"></div>
var tst_item = window.document.getElementById("test");
tst_item.style.fontSize = grid_fnt_sz;
3) Place each column description and data item intended for your DataGrid into the hidden div:
tst_item.innerHTML = "Your data";
var widthPX = (tst_item.clientWidth + 1); //Width of text in PX
Store this widthPX in an array for each column keeping only the largest found for the column.
4) When creating the layout for your grid, set the width for the column to the largest width from your column description and data for that column.
This method ensures that width of each column will be big enough to show your data without wrapping. Depending on your needs, you can tweek the logic to do what you need. This might not be feasible with large amounts of data. But, it works great for me.

WebKit CSS transformations and animations in Javascript

I'm working on a IPhone web application. I just starded playing with the webkit-transform and webkit-animation CSS rules. I've some questions: for example, is there real advantage in using these instead of, say, jQuery.animate(...)? The resulting animations don't seem to be that much accelerated and fast. Let's explain better: I've a series of images I have to move on the screen, like a gallery... I set each image CSS rules like this:
-webkit-transition-property: left, top, right, bottom, width;
-webkit-transition-duration: 200ms;
then I change the style.left and style.top of each element I want to move with new coordinates. The result is not so fast as I expected. It is fast more or less as jQuery is (not fluid at all). I've seen there is even -webkit-animation and -webkit-transform but I still don't understand how to use them properly. The first one lets me move things around, but doesn't generate an animation, I use the following code:
var trans = "translate(" + x + "px," + y + "px)";
ELEMENT.style.webkitTransform = trans;
with this the element moves around, but without an animation. If I create dynamically an animation with:
var lastSheet = document.styleSheets[document.styleSheets.length - 1];
lastSheet.insertRule("#-webkit-keyframes "+ "animX" + "{ from { top: "+oy+"px; left:"+ox+"px;} to {top: " + y + "px; left: " + x + "px; } }",lastSheet.cssRules.length);
ELEMENT.style.webkitAnimationName = "animX";
this way the element will move once, not so fludly, and well be back to it's old position. Repeating this code doesn't lead to anything.
What do you think, is there a real advantage in terms of fluidity of movement in using those? And if yes, how to use them properly?
Something like this should do what you want, and runs quite smoothly in Safari on my iPhone 4:
<style type='text/css'>
#element {
position: absolute;
top: 0px;
left: 0px;
-webkit-transition-property: top, left, bottom, right;
-webkit-transition-duration: 300ms;
-webkit-transition-timing-function: ease-in;
}
</style>
<script type='text/javascript'>
document.querySelector('#element').style.left = '300px';
</script>