Sponsored Content
The Lounge What is on Your Mind? JQuery and CSS Flex Code for Responsive WOL Page Post 303021488 by Neo on Friday 10th of August 2018 11:02:39 AM
Old 08-10-2018
JQuery and CSS Flex Code for Responsive WOL Page

I have just wrote this jQuery to the WOL page, so the table of users on line will not need scrollbars and will instead transform into a responsive table:

Code:
<script>
jQuery(document).ready(function (){
    jQuery("#neo-who-flex-tcat").
        css({"display":"flex","flex-flow":"row wrap",
            "justify-content":"space-between",
            "flex-direction":"row","align-content":"stretch"});
    jQuery("#neo-who-flex-thead").
        css({"display":"flex","flex-flow":"row wrap",
            "justify-content":"space-between","flex-direction":"row",
            "align-content":"stretch"});
    jQuery(".neo_table_wrapper").
        css({"overflow":"visible"});
    jQuery(".neo-onlinebit-flex").
        css({"display":"flex","flex-flow":"row wrap",
            "flex-direction":"row","align-content":"stretch",
            "justify-content":"stretch"});
    jQuery(".neo_table_wrapper").find("td").
        removeAttr("width").css({"align-self":"stretch",
        "width":"250","flex-grow": "1"});
});
</script>

You can check it out by going to the Who is Online Page page (members only) and change with width of your browser and when it gets small, instead of the scrollbars, the column boxes cascade down (responsive).

Code:
https://youtu.be/vFJVX4-bsVM



This means I was able to use CSS Flex to make the table responsible without changing all the table, thead, th, and td tags to divs and spans.
 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

need to know best forum site for flex code

Hi All, Please help me to know the similar forum site but for the flex code. Thanks (6 Replies)
Discussion started by: aish11
6 Replies

2. What is on Your Mind?

Man Page Repositories - Added jQuery and Bootstrap

I added both jQuery and Bootstrap Javacript libs to all man page repository pages. TODO: I need to add pagination to these repos because most are very large and load to slow on a single page. For the first upgrade, I manually added one new CSS Class (repository) to the main repo tables and... (0 Replies)
Discussion started by: Neo
0 Replies

3. What is on Your Mind?

JQuery and CSS Flex Code for Responsive Forum Home Page

So far, I have completed making the home page more responsive (except for the forum stats at the top and the WOL box at the bottom, they still use scroll bars). xevV3_iZ8-s For full screen use the link below and set your YT resolution to 1080p60 HD https://youtu.be/xevV3_iZ8-s Here is... (1 Reply)
Discussion started by: Neo
1 Replies

4. Web Development

Turning jQuery Code into Vue.js

The following is some code I am working on the replace our navbar (someday) with a Vue component. Vue.component("unix-navbar", { template: `<div class="neo-table-border vuenavbar"><div class="flex-item" style="margin-bottom:10px;padding-top:13px;"><a class="vuenavbarhome"... (19 Replies)
Discussion started by: Neo
19 Replies

5. Web Development

PHP Changes to WOL for New Forum Home Page

Wrote some PHP code today to make the Who Is Online (WOL) in the forums work properly with the new home page: Wrote this global plugin to add the location to both the user table (for members) and session table (for guests + registered users) <?php if (THIS_SCRIPT != 'misc' and... (0 Replies)
Discussion started by: Neo
0 Replies

6. What is on Your Mind?

New Responsive 404 Page for UNIX.com

Just created (actually, only modified... it was created by ShoutOut) a new responsive 404 "not found" page with the help of ShoutOut free templates. https://www.unix.com/status/404.html Same for 401 and 403 errors. Picture sans animation: ... (2 Replies)
Discussion started by: Neo
2 Replies
Table(3pm)						User Contributed Perl Documentation						Table(3pm)

NAME
Tk::Table - Scrollable 2 dimensional table of Tk widgets SYNOPSIS
use Tk::Table; $table = $parent->Table(-rows => number, -columns => number, -scrollbars => anchor, -fixedrows => number, -fixedcolumns => number, -takefocus => boolean); $widget = $table->Button(...); $old = $table->put($row,$col,$widget); $old = $table->put($row,$col,"Text"); # simple Label $widget = $table->get($row,$col); $cols = $table->totalColumns; $rows = $table->totalRows; $table->see($widget); $table->see($row,$col); ($row,$col) = $table->Posn($widget); DESCRIPTION
Tk::Table is an all-perl widget/geometry manager which allows a two dimensional table of arbitary perl/Tk widgets to be displayed. Entries in the Table are simply ordinary perl/Tk widgets. They should be created with the Table as their parent. Widgets are positioned in the table using: $table->put($row,$col,$widget) If $widget is not a reference it is treated as a string, and a Lable widget is created with the string as its text. All the widgets in each column are set to the same width - the requested width of the widest widget in the column. Likewise, all the widgets in each row are set to the same height - the requested height of the tallest widget in the column. A number of rows and/or columns can be marked as 'fixed' - and so can serve as 'headings' for the remainder the rows which are scrollable. The requested size of the table as a whole is such that the number of rows specified by -rows (default 10), and number of columns specified by -columns (default 10) can be displayed. If the Table is told it can take the keyboard focus then cursor and scroll keys scroll the displayed widgets. The Table will create and manage its own scrollbars if requested via -scrollbars. The table can be emptied using $table->clear the widgets which were in the table are destroyed. The Tk::Table widget is derived from a Tk::Frame, so inherits all its configure options. BUGS
/ Snags / Possible enhancements o Very large Tables consume a lot of X windows. o No equivalent of pack's -anchor/-pad etc. options SEE ALSO
Tk::grid, Tk::HList, Tk::TableMatrix, Tk::MListbox, Tk::Columns perl v5.14.2 2010-05-29 Table(3pm)
All times are GMT -4. The time now is 08:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy