Setting html controller to right side in firefox extension - firefox-addon

I am creating Mozilla extension.
Here I need to set button controller right side in extension.
Here I divide XUL file to div element. I have take a main div element and inside this i have take two more inner div.
Then I have set one inner div style property float:left; and another div style property float:right. But this is not helpful for me.
Here I also set Button CSS style property float:right which is inside the div which have property float:right.

In a XUL window, dialog, page or vbox, elements are displayed from top to bottom, and if you put elements in an <hbox> then those are displayed left to right (except in RTL locales). But sometimes you want a right-aligned object. You then have several options:
The simplest version is <hbox pack="end"><button label="right"/></hbox>
If you also need an element on the left, then you can separate them with a spacer, like this: <hbox><button label="left"/><spacer flex="1"/><button label="right"/></hbox>
Alternatively you can also use <vbox align="end"><button label="right"/></vbox> which works better if you need a radio, checkbox, label or description element to be able to wrap.

Hi Dad you tried to use dir="rtl" this one can be applied to the document or the element ....
You can also specify the language... like it's exist on the HTML Specification...
http://www.w3.org/TR/html401/struct/dirlang.html
For Example
<Q lang="he" dir="rtl">...a Hebrew quotation...</Q>

Related

Align table to the right of a page

I currently have an html page including a series of patterns organized as follows :
a div including a jqplot aligned to the left of the page
the associated table below the jqplot.
I'd like to align the table to the very right of the jqplot.
Here is a link showing the current organization for the html :
http://snovae.in2p3.fr/canto/scratch/spectra_sample/SN2007le_fullrun.html
As for now I don't have any style within the html.
The jqplot is called with the div and the table is not currently within any div if this helps.
Any help will be greatly appreciated.
You should set your .jqplot-target elements to have a margin-left: 0px.
Those seem to have inline style set, act on this and set their style (which is always the same) via a css acting on their class, not on each individual elements.

How to create an anchor within a div?

I'm looking for a solution that doesn't require JavaScript, jQuery or anything too advanced; mostly HTML/CSS as those are what I am restricted to using.
The idea I have is a layout with two smaller div classes within one div ID. Each box have their own content and are placed side by side. What I'm trying to accomplish is to create an anchor link within one div that changes its content to something else.
e.g. box 1 on default displays "abc" as its content while box 2 displays "def". When you click on an anchor link in box 1, the content would then change to 123-- without affecting what's in box 2 or moving it down with the anchor.
Hopefully that makes sense.
There's no code to edit/work off of so any help would be appreciated.
You can use the :target selector to hide both div, and show element with the ID in the URL hash:
div.MyBox {
display: none;
}
div.MyBox:target {
display: block;
}
Clicking an <a> tag pointing to #someId would then show that element.

What is the use of data-role="fieldcontain"?

I just discovered that text inputs within a div with data-role="fieldcontain" don't expand to the 100%, but if you place a text input outside of a fieldcontain it expands to the fullest. This is a bug that they are fixing, but meanwhile...
So I was wondering what is the use of that data-role="fieldcontain" in the first place? Why to put it? I saw it on the documents and I just put it in my html, but what is the use of putting it?
Thanks!
Looks like it's a Field Container for Grouping and Display
http://jquerymobile.com/demos/1.1.1/docs/api/data-attributes.html
Field container Container with data-role="fieldcontain" wrapped around label/form element pair
Controlgroup DIV or FIELDSET container with data-role="controlgroup". Visually integrate multiple button-styled
inputs of a single type (checkboxes, link-based buttons, radio
buttons, selects) into a group. For grouping form checkboxes and radio
buttons, the fieldset container is recommended inside a div container
with the data-role="fieldcontain", to improve label styling.
data-mini true | false - Compact sized version for all items in the
controlgroupdata-type horizontal | vertical - For horizontal or
vertical item alignment
As of jquerymobile 1.4 data-role="fieldcontain" is deprecated!
use class="ui-field-contain" instead.
see release notes http://jquerymobile.com/changelog/1.4.0/

jQuery UI tabs - how to change tab position

I have created tab layout as in this example http://jqueryui.com/demos/tabs/#bottom with controls bellow the panel. I have 3 default tabs, which can't be delted and than user can add some more tabs and also delete them.
The problem is that the default tabs should be on the top like there http://jqueryui.com/demos/tabs/#default so because UI doesn't support two control panels, I have created new element looking like control panel on top <p class="ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-top tabs-header-top"></p> with fixed heigth. But now I don't know how to move the default tabs to the right position. I tried adding them position: relative; top:-20em; ,but to make this working, the whole tab container must have fixed heigth and that's bad, because I need it to stretch within the window to be as big as possible.
So is there any other way how to move the default tabs to the top?
Thanks
edit: here is example of my idea, but achieved with fixd heigth http://jsfiddle.net/L6QjK/2/
To be clear: This method is technicaly working, so the questin is not about making tabs with two control panels, but about positioning the tabs
Not sure if it will work, but try creating two DIVs, one with default styling and one with the bottom styling:
<div class="tabs">...
<div class="tabs tabs-bottom">
and then use $(".tabs").tabs(...)
So finally I managed to create two control panels on my own by changing the jquery ui code.
If somebody is trying to make same thing as I here are some tips:
1) To create multiple control panels, find this.list=this.element.find("ol,ul)").eq(0)
now, the .eq(0) selector causes, that onlz the first ul or ol is made to control panel, so I simply modified the find selector to this :this.list=this.element.find("ol,ul:lt(2))") and the :lt(2) selector will make first two ULs to two control panels. Now we have two control panels and it is all about css positioning, you can get isnpired here http://jqueryui.com/demos/tabs/#bottom to move one control panle to the bottom.
2)I am using schema, that the first control panel contains static tabs, and to the second one are added dznamic tabs. So I also needed to change the target during adding tabs. For this you have to find h.appendTo(this.list) and change it to h.appendTo(this.list[1]) because ad.1) this.list now contains two elements and I want the tabs add to the second one.
So finaly to make two control panels tab layout isn't that hard

Wrap text in list items/buttons instead of hiding the overflow

I'm trying to override the default behavior of list items and buttons in jQuery Mobile, which has text which doesn't fit on one line as hidden overflow.
If you view this on a skinny browser window or iPhone you'll see what I mean: http://m.gizmag.com
I'd like to be able to wrap the text in the h3 and p tags of each list item onto new lines.
Thanks in advance!
Try setting a style of white-space:normal for the elements.
I just did this with an anchor (<a>) element inside a jQuery Mobile listview-styled li, and it worked to wrap the text as I expected. I used Chrome's developer tools to determine where the CSS attributes were coming from and interactively changed them to make it work the way I wanted.
--
Derek
If feasible, enclosing it inside a <div> will also make it wrap. (But finding the affected element and declaring white-space:normal is the more proper solution)
Source: http://forum.jquery.com/topic/list-items-are-truncating-text-is-there-a-way-around-this

Resources