jquery ui widget for tabbed content - javascript

Jquery ui doesn't show examples of a tabbed content widget like the list on the right http://jqueryui.com/demos/tabs/#default where you choose examples (default functionality, content via ajax, etc)
Does anyone know how to create a similar tabbed content using jquery UI? No addition scripts.

From this question there is a link to vertical jQuery UI tabs demo.
Also Wijmo Open has added an alignment property to their jQuery UI based tabs if the no additional script constraint can be stretched.

I do believe you can use the jquery ui tabs script you linked to. Use CSS to get the tabs on the right hand side and vertical, instead of along the top and horizontal.
jQuery wise I see no difference. Its a styling thing.

It is not a widget itself but a combination of event handlers and CSS. You can check the source code of it:
http://jqueryui.com/js/demos.js
I'd like to say also that the AJAX content loading is not a great solution as it is used in jQuery UI demos, because they load content via AJAX and they update hash part or URL, but you can't go back in browser history and you can't enter directly to a demo by using a special hash.

Related

Change main content on a webpage using bootstrap

I am building a webpage using Bootstrap 3. I am trying to find the best way to change the main content of the side. I have a Header, left content and right content but I want to change the middle content by pushing a button without changing the surrounding elements. What would be the best thing to use to accomplish this. Is there some demos online that someone can point out? I have been trying to find some but without luck.
Bootstrap doesn't have that feature. First try to learn what bootstrap can do or can't, what bootstrap made for.
What you are trying to do is called templating. You can use php, ajax or other methods to dynamically add content to your content section of your template.
You have many ways to do that, maybe with jQuery .load() and maybe combined with HTML5 history API or some other framework...
But Bootstrap has nothing to do with that..
You can start reading about AJAX and DOM manipulation first, but here is some link you can use:
Dynamically Loading Content in Twitter Bootstrap Tabs
You cannot do that with boot strap that is just not what it's made for you can use either PHP or Ajax personally if you know PHP already and have everything set up for go with that because in my opinion Ajax sucks to learn and work with

How to remove jQuery Mobile styling?

I chose jQuery Mobile over other frameworks for its animation capabilities and dynamic pages support.
However, I'm running into troubles with styling. I'd like to keep the basic page style in order to perform page transitions. But I also need to fully customize the look'n feel of headers, listviews, buttons, searchboxes... Dealing with colors only is not enough. I need to handle dimensions, positions, margins, paddings, and so on.
Therefore I struggle with extra divs and classes added by jQuery Mobile in order to override them with CSS. But it is so time-consuming, and it would be way faster to rewrite css from scratch...
Is there a way to load a minimal jQuery Mobile css file ?
Or should I look towards an other mobile framework ? I need to handle page transitions, ajax calls, Cordova compatibility, and of course a fully customizable html/css...
Methods of markup enhancement prevention:
This can be done in few ways, sometimes you will need to combine them to achieve a desired result.
Method 1:
It can do it by adding this attribute:
data-enhance="false"
to the header, content, footer container.
This also needs to be turned in the app loading phase:
$(document).on("mobileinit", function () {
$.mobile.ignoreContentEnabled=true;
});
Initialize it before jquery-mobile.js is initialized (look at the example below).
More about this can be found here:
http://jquerymobile.com/test/docs/pages/page-scripting.html
Example: http://jsfiddle.net/Gajotres/UZwpj/
To recreate a page again use this:
$('#index').live('pagebeforeshow', function (event) {
$.mobile.ignoreContentEnabled = false;
$(this).attr('data-enhance','true');
$(this).trigger("pagecreate")
});
Method 2:
Second option is to do it manually with this line:
data-role="none"
Example: http://jsfiddle.net/Gajotres/LqDke/
Method 3:
Certain HTML elements can be prevented from markup enhancement:
$(document).bind('mobileinit',function(){
$.mobile.keepNative = "select,input"; /* jQuery Mobile 1.4 and higher */
//$.mobile.page.prototype.options.keepNative = "select, input"; /* jQuery Mobile 1.4 and lower */
});
Example: http://jsfiddle.net/Gajotres/gAGtS/
Again initialize it before jquery-mobile.js is initialized (look at the example below).
Read more about it in my other tutorial: jQuery Mobile: Markup Enhancement of dynamically added content
...or just use the official, theme-less version of the CSS built specifically to allow the design of a custom theme while maintaining all of jQuery Mobile functionality.
You don't have to fight with hacks and overrides all the time and you get a lighter CSS.
Win-win.
edit: Also answered here
To be honest i'm fairly disappointed that jQuery mobile didn't provide us with a relatively style-free starting kit, to work merely with what you have said: Ajax, transitions, cordova...
Overriding the generated css classes is absolute madness, but I have done some skunk work and I managed to reduce the uncompressed css file size from a whooping 233kb to merely 27kb, while keeping the important aspects of the css such as transitions, one-page viewing, etc. This way you start almost as you would start with an empty css file.
Perhaps I will upload the file on Github, if there's any demand for it. I wish to do some more testing to see that I didn't leave anything significant behind.
as of jQuery Mobile 1.4.0, the data-enhanced data attribute was added to most of components. Setting this as true attribute will cause jQuery mobile to ignore style enhancement for the component, so you'll have to style the element by your own.
additional information about this in the jQuery Mobile 1.4.0 release notes here
http://jquerymobile.com/upgrade-guide/1.4/
i m nô expert but i would love to share à weird method with you . Actually, it s very hectic task : what you need is to edit the jqm css line by line by deleting the property values just leave them blanks before ; you have just to look after the desired sections of the CSS file to adjust or delete value
Do not forget to attach your link rel of your own CSS at the head of your HTML page
I hope it will work for you

jquery modal / dialog

I want to use some jquery plugin to show modal. I have been using fancybox but it has problem that second fancybox can not be shown on one. I have used jquery UI but it has images and I want some plugin which is not dependent on images. Here are my requirements:
to show on page load
to show on ajax success
customizable with custom css
second modal/dialog can be shown on first one.
Please suggest.
I like http://jqueryui.com/dialog/ I know you said that you used it but did not like it as it has images, but I would override your images with custom css - which is not to difficult. simnple model is fine but I find ui better
Your question is not in the Q&A format of Stackoverflow, because you are essentially soliciting opinions (i.e., no definitive answer).
Nevertheless, SimpleModal is an excellent light-weight jQuery plugin I've used for modal dialog boxes.
Have a look on this one, I used it in the past: http://www.paulund.co.uk/how-to-create-a-simple-modal-box-with-jquery

JQuery Mobile Sub page

As I know that in JQuery Mobile, every page changing is equivalent to create new "page" div, Can we just change a portion in the "content" of the page, something like subpage?
jQuery Mobile doesn't require you to manage pages by creating additional div element in the same HTML file - you can do it perfectly fine in a different HTML file and make a transition to it (perhaps with data-prefetch attribute set) using <a>.
Nothing prevents you from writing a jQuery plug-in, jQuery UI plug-in or (scary though, I know) pure JavaScript that will alter the contents of the DOM element dynamically and manage pages loading according to data received from server - with necessary calls to things of the listview('refresh') ilk - to ensure proper styling.
With that said you have to ask yourself two things:
Why do you need to do it? Can't you manage by pre-creating the page using jQuery Mobile paradigm and just retrieving and inserting the data into the new page?
What will the performance implication (if any) will be, if I have to perform DOM manipulations on every 'page transition'?
As a side note - jQuery Mobile provides you with methods that allow for page manipulation:
$.mobile.changePage and $.mobile.loadPage that you can use (look at pageContainer option).
See API docs here
I am trying to use right now a jQueryMobile plugin for subpages: https://github.com/ToddThomson/jQuery-Mobile-Subpage-Widget
I didn't make it work yet but i think it should work :).

jQuery Tools (horizontal accordion) combined with jQuery UI (tabs)?

Hello everybody and thanks for taking your time.
I got an existing project where the main-page uses a horizontal accordion for the main content area from jQuery Tools (the Tabs element).
Now i have to implement a Tabs-menu (into one of the existing accordion pages) which is build with jQuery UI (the main container are Tabs and inside of them are several nested accordions).
Is there any easy way I can solve this problem and combine jQuery Tools with jQuery UI?
I did a search-replace on the tabs code of jQuery UI (js+css) and changed everything from "tabs" to "tabsnew"..
The script seems to work with this, but the css is not working correctly with this (even tough I changed all elements which are used to build up the Tabs).. I think there must be an easier solution for this..
I'm very thankful for any ideas or solutions!
Drop jQuery UI and implement the tabs again in jQuery Tools. If this is production code for a website there's no reason the users should load both libraries.

Categories

Resources