Yii2 eliminate double horizontal scroll [closed] - scrollbar

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I used kartik gridview plugin and I have a gridview with a lot of columns so it generated a horizontal scroll bar. But the page generates 2 scroll bars. One for the gridview and one for the page. How to eliminate the body scroll? and how to make the gridview horizontal scroll sticks so that the user will no longer need to scroll to the bottom in order to see the horizontal scroll?

For the body scroll simply try adding in your index view
<style type="text/css" media="screen">
body {
overflow-x: hidden;
}
</style>
For the second question could be useful reduce (in pagination ) the number of lines displayed
eg: this way
public function actionIndex()
{
$searchModel = new YourModelSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$dataProvider->pagination->pageSize=5;
...........

Related

Constraints on a Vertical Stack View with 3 Images

I have just started coding so forgive me if this is a very simple question but when I try to autolayout my stack view, I can't seem to get everything in the screen? When I change the top and bottom, 1 of the images gets truncated:
Make sure your Stack View properties are set to:
(with whatever vertical spacing you want)
Then constrain all 4 sides of the Stack View to the view (best to always respect the safe area):

how to do column stacking using css in wordpress [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
i have 2 rows and both rows have 3 columns each having 3 blurbs. what i want to do is that when i make it responsive and lower the resolution at a point these two rows should be converted to 3 rows having two column each instead of having three columns. All using the CSS please
You cannot do this without either a) manipulating the DOM tree with JS dynamically, or b) code up your all your different rows with the correct amount of columns to show for each viewport and then hide and show (swap) these at a certain breakpoint with a media query.
With JS you could avoid duplicating html markup. A pure CSS solution will not be possible without duplicating the markup/content.
For b) your would start with your 2 rows x 3 cols visible and the 3 rows x 2 cols would be hidden with display: none;. Then, as your viewport narrows down you would hide the visible rows with a display: none; for each and reveal the three hidden rows with a display: block; on each of them.

How to have multiple lines in a treeItem in a treeView in JavaFX?

I was creating like a forum with javaFX. And the question and it's answers are formed using a treeView. Like the question would be a root and it's answers would be it's nodes.
But, it's happening that the treeItems are going straight in only one line, creating a horizontal scroll, and after some words, just putting '...' instead of the rest of the answers. I am using scene builder. Can anyone please tell me a way so that I can eliminate the horizontal scroll, and have the answer in multiple lines?
You have to set the cell's WrapText property, e.g. in the column's cell factory.
Some answers like this one indicate that you have to bind the wrappingWidthProperty to a certain length if you use custom controls inside your cell.

does anyone know how to do this css transition? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I am killing my neurons trying to figure out how to do this website's navigation bar with css transitions or animations: http://tabu.realitatea.net/ .
Does anybody know how to do it ? or even give me a starting point ?
This was pretty fun to make, check it out. https://jsfiddle.net/6brsm2zt/
JS
var slider = $('#slider');
$('div').on('mouseenter','a',function(){
var box = $(this);
var p = box.position();
slider.animate({
width: box.outerWidth(),
left: p.left,
},250);
})
$('div').on('mouseleave','a',function(){
slider.stop();
})
$('div').on('mouseleave',function(){
$('#slider').animate({
width: 0,
left: 0,
},200);
})
The basic idea is to have a zero width div on the left, let's call it a slider. When you mouse over an item, you set the width and left position of the slider to be equal to the width and left position of the item. The duration of the animation is quite short, about a third of a second, to give the feeling of responsiveness.
When you mouse off the bar entirely, just set the width and left position of the slider to 0 with a short duration, say 200 ms, and it'll zoom off to the side.
One tricky part is when you wave the mouse back and forth. Originally, the div would play the transition for each item, leaving me waiting for the slider to finally come to my mouse. I solved this by cancelling the animation when i mouse off an item. Since the event order for mousing between items is mouseenter -> mouseleave -> mouseenter, i already had a transition for mouseenter ready to go. Now the slider will chase your mouse relentlessly :D.

How do I center a set of JQuery Mobile radio buttons in the viewport?

I'm making an app using JQuery Mobile on top of PhoneGap (Cordova). I used Codiqa to come up with a wireframe for my UI. It looks OK so far, but the group of radio buttons I'm going to use to change views with wasn't centred - it was off to the left by about 25px on a WVGA800-sized webkit browser. When scaled to a tablet shape, the group got further and further from the centre of the viewport.
Here's a jsFiddle link to my project with the problem unfixed - http://jsfiddle.net/jaspermogg/sahXy/1/
Here's a jsFiddle link to my project as fixed by me - http://jsfiddle.net/jaspermogg/NvMsK
I came up with a solution using JQuery, but I'm inexperienced and don't know which event to fire on.
When I load the UI in Webkit, it renders the UI pre-script, before refreshing after <1s to a post-script state. This looks lame. I have my script set up to run on $(window).load.
Questions:
What event should I be looking for, and could you show me how to implement that?
Is my script in the right place - should it be inside the page, the way it is, or outside? Or in head even?
It feels really stupid to be doing this with JQ - surely there's a way to do this with CSS?
Thanks in advance for any help offered! Cheers!
I guess I answered my own question in the comments above, so gonna formalise it by accepting my answer.
What I did in the end was -
(1) Set the radio button-containing div to visibility: hidden in the CSS.
(2) Find the widths of each radio button and add them together.
(3) Set the width of the radio button-containing div to the total width.
(4) Chain a change of the visibility property onto (3).
The CSS has to be set up like this -
#viewselector{
margin: 0 auto;
text-align: center;
visibility: hidden;
}
The code to do (1) to (4) is as follows -
$(document).ready(function(){
var idealwidth = 0
$(".ui-radio").each(function(){
idealwidth = idealwidth + $(this).width();
});
$("#viewselector").width(idealwidth).css('visibility','visible');
});
Hope this helps someone!

Resources