how to make Zurb Foundation non-responsive? - frameworks

I have made a website with Foundation-master wordpress theme, it looks good but I dont like how its behaving in other browser widths. Is there a way of making it non-responsive, or fixed to a certain width?
Thanks!

Sometimes it's necessary to deactivate the responsive features. For example if, like it happened to me twice already, a website is launching non-responsive and the optimization for smartphones/tablets is added later.
Foundation is an awesome framework even if you take out the responsiveness. The SCSS files are very well structured it comes with a library of very useful UI elements. It's a great choice for responsive and non-responsive sites if you ask me. Some people might also want to streamline their workflow and not jump between different frameworks depending on the project to keep costs low.
Anyways, here my two cents. This deactivated all responsiveness for me:
.row {
width: 62.5rem;
}
And then in the _settings.scss
$small-range: (0, 90em);
$medium-range: (0, 90em);
$large-range: (0, 90em);
This way we're essentially always seeing the large version. As far as I can tell this even works for top bar etc.

Foundation was built to simply create responsive websites.
Beside of the question why you use this framework if you don't want a responsive webseite, it's only possible if you start removing all the media queries in foundation css and by removing the viewport meta tag.
Maybe you should better invest this time to make your webseite responsive so that it also fits on smaller screens and mobile devices.

Although the question is marked as answered, I just wanted to give you a quick hint to prevent the Foundation 4 grid to act responsive, since we had also to deal with that.
In our case (SASS version) setting the width of the <body> element via css to the specific width of the grid and reducing the breakpoint in the SASS variable $small-screen to 1px worked fine.

Try to add a min-width in the body attributes like this:
html,
body {
font-size: 100%;
min-width: <value A>;
max-width: <value A>;
width: 100%;
}
(foundation.css)

Related

ion-toggle : Reduce size of toggle button

Is there any way to reduce the size of ion-toggle button.
The picture depicts my problem.
try this
ion-toggle {
zoom: 0.8;
}
In case you are creating toggle button like this:
<label class="toggle">
<input type="checkbox">
<div class="track">
<div class="handle"></div>
</div>
</label>
Use .toggle .track class to adjust following css properties:
width: 51px;
height: 31px;
and then .toggle .handle to adjust following css properties:
width: 20px;
height: 20px;
border-radius: 20px;
top: 7px;
left: 7px;
You may also add your own class name to change appearance of specific toggle buttons.
In case you are using ion-toggle directive as in
<ion-toggle ng-model="airplaneMode" class="toggle-small" toggle-class="toggle-calm">Airplane Mode</ion-toggle>
You can try to see if applying class="toggle-small" changes appearance as per your need. However, above class modifications can still be applied to this directive.
From what I can tell you will need to customize three CSS definitions: .toggle-icon, .toggle-inner, and .toggle-checked .toggle-inner.
.toggle-icon: width and height change the size of the toggle "track"
.toggle-inner: width and height change the size of the toggle "button" that slides in the track
.toggle-checked .toggle-inner.: transform: translate3d(27px, 0, 0) The first arg changes the position of the button when it is pressed
The following shows how to enlarge so to answer the OP you can simply use smaller values to get a minuscule toggle.
CSS zoom suggested above appears to be outdated 2017 post in my calendar is not that old. Anyways, it does not take virtual units.
While I am constantly fighting all this non-sense of frameworks and CSS cryptic lingo I have been always trying to use virtual units even for font-size. Because they are a percentage of the real-estate a platform presents, I feel they provide better results with a single specification, occasionally I specify separately for portrait and landscape.
So for the toggle I have derived the following gathering from all your inputs and other posts. In order to have a decent appearance I tend to like things large but they still have to fit an iphone, android and my TV 1920 x 1000
I personally think it's totally stupid to keep speaking and specifying CSS with weird units like px, em, etc....
Here is the looks on an iphone
Here is the looks on my large TV
As you can see I still have some more styling to do for the radio-buttons they are tiny on my 1920 x 1080 TV. I will derive a style common for both that will work (unlike the Ionic default which DOES NOT, otherwise we won't be here, would we?).
Programmers should NOT have to do this, It's a shame frameworks make it such a pain, when they claim to do the opposite (enabling you to publish on various platform).
Thanks for #amuramoto for the translate, I am just hacking my way thru the dev tools figuring out all this terrible mess.
Here is what I cooked up for the radio-buttons I don't know why I am having to use 5.5vmin to center the .radio-icon ?? it's not looking great on the iphone yet. Perhaps someone can improve on this?
here are the radio-buttons on the 1920 x 1080 resolution

Issue with scrolling in iOS 5 using -webkit-overflow-scrolling

I have an HTML page with a fixed-height div which should be scrollable (only vertically). In iOS 5 this can be achieved using:
overflow-y: auto;
-webkit-overflow-scrolling: touch;
The div contains an unordered list with about 10 items.
The scrolling works, but sometimes it scrolls only if I swipe my finger diagonally or even horizontally and not vertically as it should be.
I'm wondering if anyone has encountered this issue. I don't want to think that it is a bug in iOS5, but I can't figure out what I'm doing wrong because most of the time it works fine.
I had exactly the same issue. The problem turned out to be caused by two zero size iframes my site used to track history changes and load scripts. Removing these fixed the issue. I filed a bug with apple, waiting to hear back from them.
Check to see if you have any iframes on your page they could be the cause.
I have found a hacky solution but it needs javascript...
I stumbled upon that problem while loading scrollable nodes via ajax and appending them with js.
I found out that resetting the -webkit-overflow-scrolling property with js saved the day
JS CODE:
var myDiv = $('.myDiv');
myDiv.css('-webkit-overflow-scrolling','auto');
function fn(){
myDiv.css('-webkit-overflow-scrolling','touch');
}
setTimeout(fn,500);
It really sucks that we have to call the setTimeout method but that's the only way I could think of...
EDIT : Watch out for display:none
Webkit overflow scrolling touch CSS bug on iPad
You need to put this css setting in your css file - the one you load using the content_css configuration variable:
body {
-webkit-transform: translate3d(0, 0, 0);
}
The other option is to set the css directly from code on tinymce initialization:
$(tinymce.activeEditor.getBody()).css('-webkit-transform', translate3d(0, 0, 0));
I had the same problem in iOS 5.1.1 and it turned out to be due to an ::after pseudo-element with position: fixed that was on an element that contained the scrollable list exhibiting the "wrong scroll axis" behavior. Details here.

Custom skin for facebook like button

Is there an (easy) way to customise the look of the facebook like button implemented via fbml?
I am pretty sure I saw this somewhere, but I cant remember where and I cant find any documentation on this.
You don't need to make these illegal hacking. Just use the "Open Graph": https://developers.facebook.com/docs/opengraph/actions/builtin/likes/. The downside is you need to create an app.
Are you guys lawyers or programmers? the question was HOW not '...to do or not to do...'.
#pixelistik button can be inserted either via script tag or iframe and of course you can use css with iframe just via JS, easy peasy.
#skrat good point!
#Slavic what service exactly? I call it half-service because you can like only - no place for criticism so... your criticism is not proper. Like our posts! :P
generally: if you create custom button and you didn't sign to any t&c or something like that you can do whatever you want on YOUR webpage.
Although it may not even be legal to do so (check the terms and policies for yourself), you could do something like:
/* Like button main text color */
div.like span.connect_widget_text {color:#fff;}
div.like div.connect_widget_confirmation {color:#fff;}
div.like span.connect_widget_text a {color:#ffc6ff;}
This link shows some mild styling options:
http://forum.developers.facebook.net/viewtopic.php?pid=236534
Easy peasy:
Simply set the opacity (filter for ie) to 0 and put the iframes over an image or div with a bg image. For bigger buttons simply load in multiple like buttons, don't load in too many this will make your page unbearable slow.
Hiya, you can do it with some smart CSS - http://www.esrun.co.uk/blog/disguising-a-facebook-like-link/
Although the legality of such edits is under question, I just wanted to share my findings on this subject.
I right clicked on a FB Like button in Firefox, and inspected the element with firebug. The readout of the class elements is:
.connect_widget_like_button .liketext {
background: url(http://static.ak.fbcdn.net/rsrc.php/v1/y7/r/ql9vukDCc4R.png) -1px -33px no-repeat;
background-image: url(http://static.ak.fbcdn.net/rsrc.php/v1/y7/r/ql9vukDCc4R.png);
background-repeat-x: no-repeat;
background-repeat-y: no-repeat;
background-attachment: initial;
background-position-x: -1px;
background-position-y: -33px;
background-origin: initial;
background-clip: initial;
background-color: initial;
}
This exists on line 172 of like.php
One company I know of that does use a custom like graphic is Disqus, however their button is a multi-functional element that offers you a choice between facebook & twitter onClick, which may be how they were able to customize it to their needs.

Ajax Accordion and IE8 rendering problem

I have an accordion control that is generated in code. Earlier today it stopped rendering correctly in IE8. It would function ok, but sometimes the layout would get corrupted, and all kinds of weird graphical glitches occured. It did not fail in firefox.
I reset my IE settings to factory defaults and it fixed it. It works perfectly on another test machine, but on some of the machines on our network the graphical issues occur.
Has anyone else experienced the same or know a fix? All of our computers run internet explorer 8. If it becomes a big problem I will try forcing compatibility mode but I would prefer a more permenant fix (and also that might not even fix the issue!).
I've had issues like this in the past, most typically an issue with some CSS settings. If you use the developer tools in IE, look to see what CSS settings are being applied and try to rule that out.
A screenshot of what is happening and what should happen would be useful along with the code sample.
On your accordion headers only, place the following css code:
.accordionHeader { display: table; width: 100%; }
If you find that the headers still jump when hovering between them, use a border-top using a solid colour rather than using margin and padding. Of course this only works on designs ontop of solid colours (the border colour would need to match the background colour). Heres an example:
.accordionHeader { border-top: 10px solid #FFFFFF; }
This will fix IE8 right up! This has taken me a year to figure out lol.

Scrollable div on iPhone without using 2 fingers?

I've got a UIWebView embedded in my iPhone app, and I'd like to keep a locked header and footer DIV on the page at all times, with a scrollable center DIV.
I know that I could do this using a header/footer that are UIView controls, but I want the header and footer to be HTML divs, as a pure HTML/JS/CSS solution will be easier to port to Android/PalmPre/AdobeAir, which is going to be on my todo list relatively soon.
I can do this using techniques like the one mentioned here:
http://defunc.com/blog/?p=94
But this requires that the user use 2 fingers to scroll the div, which is not satisfactory to me...
Any suggestions on how to do this?
Thanks,
Brad
I found someone that implemented a reusable solution for this, with a header and a footer:
http://cubiq.org/iscroll-4
I'm not too familiar with the UIWebView, so this may be a totally silly suggestion. But is there anything stopping you from having three UIWebViews on the page? One for the header, one for the body, and one for the footer. Because breaking it up sounds like the right idea.
Is this what you're looking for? Open this link on your iPhone device or simulator.
The index.html file has three div elements for "header", "container" and "footer" directly under the body, while all the work is done in the fixed.js file. The document is fixed in place by canceling the normal action for the "touchmove" event:
// Disable flick events
disableScrollOnBody : function() {
document.body.addEventListener("touchmove", function(e) {
e.preventDefault();
}, false);
},
Then, a lot of work goes into creating event listeners for the "touchstart", "touchmove" and "touchend" events which are attached to the "content" div under "container". The logic boils down to simply moving the "content" div up and down.
This solution is 100% HTML/CSS/JavaScript, however there is some WebKit proprietary CSS and JavaScript which may limit portability. It may take a bit of tweaking to work on another mobile device but this would be a good proof-of-concept to start from.
I did not create this awesome sample project, I'm merely bringing it to the community's attention. For more information and a link to the zipped project, read Richard "Doctyper" Herrara's entire post on Fixed positioning in Mobile Safari.
May be clunky, but you could reposition the header and footer over top of the div as the user scrolls. This way your main div doesn't need to be scrollable. No help for anything (still) using frames though.
This is one of the more irritating browser issues with the iPhone/touch, I wish you could just focus on part of the page like a normal browser.
For a CSS only reference the Safari CSS Reference probably has what you are looking for. You'll be especially interested in anything starting with "-webkit" or "-khtml" as those are extended properties only available with WebKit like 3D and touches. Should apply to Android as well.
With JavaScript the Introduction to WebKit DOM Programming Topics and WebKit DOM API Reference are go-to guides. Definately take a look at the light-table demo for some copy and paste javascript on handling your touches as that's how I would solve this.
I have implemented iScroll on iphone and it is really smooth and fast and you can do whatever you want. Disadvantages are that android (1.6) refuses to scroll how I wanted and sometimes block other javascript if there are any.
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
<div style="overflow: scroll">
Add those to your html code may solve your problem.