Adjusting jssor slider size - jssor

I need to adjust the width and height to the width and height of my div which is width:250px height 170:px. I am using jssor slider and it keep giving me a full stretched width img Please kindly help me with this. this is the code below.
jssor_slider1_starter('slider1_container');

Please use $FillMode option.
var options = {
...
$FillMode: 2, //[Optional] The way to fill image in slide, 0 stretch, 1 contain (keep aspect ratio and put all inside slide), 2 cover (keep aspect ratio and cover whole slide), 4 actual size, 5 contain for large image, actual size for small image, default value is 0
...
};
Reference: http://www.jssor.com/development/reference-options.html

Related

How to Calculate the Height and Width of Forms in Powerhsell?

Can someone help me in understanding how to calculate the Height and Width of a Powershell Forms. For Example I Created a blank Powershell form of Height 500 and Width 700 and now If want to place a Text box a little below from the top of the form what will be the height and width that I need to enter? and If I want to place a Button at middle of the Form? what will be the height and width that I need to enter? I am struggling with this calculation.
You should get the screen size and use the ratio to set position. The ratio is useful for different screen size.

How do I set a maximum text width for a GtkTextView?

I have a GtkTextView, and I would like to be able to set a maximum line width for the text. If the width of the TextView exceeds the maximum text width, the extra space should be filled with padding on the left and right on the text. Although Gtk supports a min-width CSS property, there appears to be no max-width property. Instead I tried to dynamically set the margins whenever the TextView is resized by connecting size-allocate to
def on_textview_size_allocate(textview, allocation):
width = allocation.width
if width > max_width:
textview.set_left_margin((width - max_width) / 2)
textview.set_right_margin((width - max_width) / 2)
else:
textview.set_left_margin(0)
textview.set_right_margin(0)
This produces the desired text line width for any given TextView width, but leads to strange behavior when resizing the window. Resizing the window to a smaller width happens with a slow delay. Attempting to maximize the window makes the window jump to a width much larger than the screen. size-allocate may not be the correct signal to connect to, but I have not been able to find any other way to dynamically set margins when the TextView is resized.
What is the correct way to achieve a maximum text line width?
I came up with a solution. I created a custom container by inheriting from GtkBin, overrode do_size_allocate, and added my GtkTextView to that container:
class MyContainer(Gtk.Bin):
max_width = 500
def do_size_allocate(self, allocation):
# if container width exceeds max width
if allocation.width > self.max_width:
# calculate extra space
extra_space = allocation.width - self.max_width
# subtract extra space from allocation width
allocation.width -= extra_space
# move allocation to the right so that it is centered
allocation.x += extra_space / 2
# run GtkBin's normal do_size_allocate
Gtk.Bin.do_size_allocate(self, allocation)

How to resize a image by it's width and Maintain Aspect Ratio

I want to resize or scale a image down by it's width is fixed. I have been searching all over the network, it's about resizing the image to new size by specifying new CGSize value. I only want to scale it down by its width is fixed, like 100px, and the height scale down and Maintain it's Aspect Ratio.
check this out and modify as per your needs.
http://code.developwithus.com/iphone/resize-image-in-iphone-sdk/

GWT - how to precisely set rendered width of TextArea in pixels?

I need to render a TextArea in an exact pixel width for the special purposes of my GUI.
When I set its width to "250px", it comes out as 256px.
Is there a way to override this behavior so I can render it as 250px exactly?
When you use setWidth(), you're effectively setting the element's content width.
To get the offset width use UIObject#getOffsetWidth(). This will return the width including padding and border (but not margins).
References on W3C
Computing widths and margins
The box model

SCROLLVIEW minimum zoom size

guys.i'm new to iphone.i run the zoomingpdfview demo,everthing is fine,except that i don't want the pdf is zooming out smaller than the screen's size,or even very small..
i've tried many ways,but still can't.
so,how can i achieve that goal?thanks in advance.,any advice will be gratefull.
There's a property on a UIScrollView called minimumZoomScale. However, this isn't measured in pixels, it's measured as a factor of the size of the view.
You will need to calculate the min zoom yourself i.e.
// for a pdf width 230 and screen width 360 your min zoom would be 2.0
// a pdf width 720 and screen width 360 your min zoom would be 0.5
// So, to set the zoom for a scroll view
[myScrollView minimumZoomScale:screenWidth / pdfWidth];
However, you might have to calculate this for each visible page - pdfs can have pages of different size :)