Đang tải dữ liệu...
New- Bạn muốn dùng cái kiểu menu bên trái rất mới này ko - SinhViênIT.Net ||Diễn Đàn Sinh Viên CNTT
 
 
Đang tải...
 
       
Trở lại   SinhViênIT.Net ||Diễn Đàn Sinh Viên CNTT > Thế Giới Lập Trình Viên > Lập trình web > JavaScript / Ajax
Đổi username Đăng ký Hỏi/Ðáp Danh sách thành viên Nhóm Lịch Tìm Kiếm Bài gửi hôm nay Ðánh Dấu Ðã Ðọc

Nội quy diễn đàn SinhVienIT.net
Danh sách các Thành viên bị cấm
Lối sống phản khoa học của dân IT
Sự đổi mới ở SinhVienIT.Net [Lần 1]
Thư viện bài giảng tin học chỉ có ở SinhVienIT.Net
Làm gì khi down đính kèm bị lỗi
Thông báo về sự cố ổ cứng của Server sinhvienit


Trả lời Gởi Ðề Tài Mới
Lần đọc: 416 - Trả lời: 0  
Ðiều Chỉnh
  #1  
Cũ 15-06-2009, 06:39 PM
Vũ Thanh Lai's Avatar
Vũ Thanh Lai Vũ Thanh Lai đã thoát
Đầy tớ Nhân Dân
Tên Thật: Vũ Thanh Lai
Giới tính: Nam
Đang học trường: ĐH Tôn Đức Thắng
Đang học khoa: Công nghệ thông tin
Nghề Nghiệp: Sinh viên
Cấp độ: 64 [SinhVienIT.NetSinhVienIT.NetSinhVienIT.NetSinhVienIT.NetSinhVienIT.Net]
Hoạt động: 2381 / 2381
Điểm: 3254 / 11354
Kinh Nghiệm: 50%
Thành Viên Thứ: 1
Tham gia ngày: 29-09-2007
Đến từ: Định quán, Đồng nai
Tuổi: 19
Bài gửi: 9,764
Đã Cám ơn: 679 bài viết
Được cám ơn: 5,986 Lần trong 3,222 Bài viết
Mặc định Bạn muốn dùng cái kiểu menu bên trái rất mới này ko

Bạn muốn dùng cái kiểu menu bên trái rất mới này ko

Nguồn bài viết: http://sinhvienit.net/@forum/showthread.php?t=8716
Demo: http://www.jankoatwarpspeed.com/exam...vancedDocking/
The requirements


This is how docking should behave:
  1. When user hovers an item on vertical menu, its submenu should slide in from left to right (points 1 and 2 in the image below) and overlay the content
  2. When user move the mouse pointer outside the panel it should slide back
  3. If user clicks on "Dock" link (point 3 in the image below), panel should fix in the current position while content moves to the right of the panel in order to be seen
  4. If users "undock" the panel it should slide back
This way users can chose whether they want to perform an action and continue with work or they want to have available actions permanently visible.

But that is not all. I wanted multiple panes to be able to dock in the same time. If one panel only is docked it should be 100% height. With each new panel docked, height should be recalculated so that all panels have the same height value (like in the image below). If there are docked panels and user wants to slide in another panel temporarily, it should overlay docked panels.

A "brief" explanation

The idea was to have a navigation based on nested ULs. This is nothing new, but I wanted to create more than just CSS&UL based menus that can be used as toolboxes or action links as well. So the structure is very simple. The main UL with id="dock" will act as a vertical navigation bar that contains three links (in this example). Each link will have a nested UL that will represent a docking panel with some sample list items. Each first listitem will act as a header for docking panel, containing panel title and Dock/Undock exclusive links.
HTML Code:
<ul id="dock">
    <li id="links">
        <ul class="free">
            <li class="header">
                <a href="#" class="dock">Dock</a>
                <a href="#" class="undock">Undock</a>Links
            </li>
            <li><a href="#">This is one item</a></li>
            <li><a href="#">This is one item</a></li>

            <li><a href="#">This is one item</a></li>
            <li><a href="#">This is one item</a></li>
            <li><a href="#">This is one item</a></li>
        </ul>
    </li>
    <li id="files">
        <ul class="free">
            <li class="header">
                <a href="#" class="dock">Dock</a>
                <a href="#" class="undock">Undock</a>Files
            </li>
            <li><a href="#">This is one item</a></li>
            <li><a href="#">This is one item</a></li>
            <li><a href="#">This is one item</a></li>
            <li><a href="#">This is one item</a></li>

            <li><a href="#">This is one item</a></li>
        </ul>
    </li>
    <!-- more submenus here -->
</ul>
<div id="content">
    <!-- content here -->
</div>
Let's see how CSS can help use to style this lists.
HTML Code:
body{margin:0px; font-family:Arial, Sans-Serif; font-size:13px;}
/* dock */
#dock{margin:0px; padding:0px; list-style:none; position:fixed; top:0px; height:100%;  z-index:100; background-color:#f0f0f0}
#dock > li {width:40px; height:120px; margin: 0 0 1px 0; background-color:#dcdcdc; background-repeat:no-repeat; background-position:left center;}
#dock #links {background-image:url(links.png);}
#dock #files {background-image:url(files.png);}
#dock #tools {background-image:url(tools.png);}
#dock > li:hover {background-position:-40px 0px;}
#content {margin: 10px 0 0 60px;}   The main #dock UL has fixed position in the top left corner of the window in order to be visible after scrolling. Each listitem in #dock unordered list presents one vertical link which hovering causes its child list (or simply - docking panel) to slide-in. I used CSS sprites to show hover states for each LI. 
  body{margin:0px; font-family:Arial, Sans-Serif; font-size:13px;}
/* dock */
#dock{margin:0px; padding:0px; list-style:none; position:fixed; top:0px; height:100%; 
    z-index:100; background-color:#f0f0f0; left:0px;}
#dock > li {width:40px; height:120px; margin: 0 0 1px 0; background-color:#dcdcdc;
    background-repeat:no-repeat; background-position:left center;}
#dock #links {background-image:url(links.png);}
#dock #files {background-image:url(files.png);}
#dock #tools {background-image:url(tools.png);}
#dock > li:hover {background-position:-40px 0px;}
Also, we need to style docking panels. First three lines in this CSS script define styles of listitems on docking panel in normal and hover state. Fourth line sets visibility of nested UL's while hovering its parent LI's. Next line defines the docking panel itself. Each panel is positioned absolutely, and initially will be hidden (left: -180). Also each one of them will have z-index:-1 in order to be shown above docked UL's that have z-index:-2.
So far, so good. If wanted to create a simple CSS based navigation I could have done it with CSS only. But I want the panels to slide-in and slide-out on hover.
HTML Code:
$("#dock li ul").height($(window).height());
$("#dock li").hover(function(){
    $(this).find("ul").animate({left:"40px"}, 200);
}, function(){
    $(this).find("ul.free").animate({left:"-180px"}, 200);
});
This jQuery scripts does exactly what I want. Te first line sets the height for each panel to be the same as window height. Now we have menus that work.
Docking/undocking functionality

Now when menu works, I can add docking functionality. The goal is to be able to dock as many panels as I want, and they all should be visible one below each other. To achieve this I need to count how many panels are docked and to recalculate their heights to fit inside the window. When panel is docked, its "free" CSS class will be replaced with "docked" class in order to have a clear distinction between docked and undocked items and to ease the manipulation.
The code below then recalculates heights for each docked panel and hides "dock" link and shows "undock" link. It will also check for number of docked items in order to move content to the right if at least one panel is docked.
HTML Code:
$(document).ready(function(){
    var docked = 0;
    
    $("#dock li ul").height($(window).height());
            
    $("#dock .dock").click(function(){
        $(this).parent().parent().addClass("docked").removeClass("free");
        
        docked += 1;
        var dockH = ($(window).height()) / docked
        var dockT = 0;               
        
        $("#dock li ul.docked").each(function(){
            $(this).height(dockH).css("top", dockT + "px");
            dockT += dockH;
        });
        $(this).parent().find(".undock").show();
        $(this).hide();
        
        if (docked > 0)
            $("#content").css("margin-left","250px");
        else
            $("#content").css("margin-left", "60px");
    });
});
Undocking functionality is very similar. It actually do an opposite actions in comparing to docking functionality
HTML Code:
$("#dock .undock").click(function(){
        $(this).parent().parent().addClass("free").removeClass("docked")
            .animate({left:"-180px"}, 200).height($(window).height()).css("top", "0px");
        
        docked = docked - 1;
        var dockH = ($(window).height()) / docked
        var dockT = 0;               
        
        $("#dock li ul.docked").each(function(){
            $(this).height(dockH).css("top", dockT + "px");
            dockT += dockH;
        });
        $(this).parent().find(".dock").show();
        $(this).hide();
        
        if (docked > 0)
            $("#content").css("margin-left", "250px");
        else
            $("#content").css("margin-left", "60px");
    });
Nguồn bài viết: http://sinhvienit.net/@forum/showthread.php?t=8716
1 Số lưu ý khi sử dụng file đính kèm:- 1- Không cần đăng ký thành viên cũng có thể tải file đính kèm.
2- Tốt nhất hãy dùng Firefox hoặc IDM down các file đính kèm dạng Zip,Rar (Ko dùng IE 7).
File Kèm Theo
Kiểu File : zip SinhVienIT.Net--2009_6_advanced_docking.zip (29.0 KB, 69 lần tải)
KHÔNG SUPPORT QUA YAHOO, EMAIL & TIN NHẮN , HÃY POST BÀI TRÊN FORUM ĐỂ NGƯỜI CÓ THẮC MẮC TƯƠNG TỰ CÓ CÂU TRẢ LỜI
Phần mềm nối file dạng .001,.002... hay .a,.b...Code trắc nghiệm trực tuyến Pro Full Lang việtSkin SinhVienIT.Net Ngày 19/8/2009
Code Lưu bút trực tuyến Pro Lang việt + ĐẹpSkin Pro cho Forum IT (3.8.4)Code Trang home của SinhVienIT.Net (23/8/2009)
Code Data.SinhVienIT.Net 2.0Code trang Tools của SinhVienIT.NetCode quản lý điểm học sinh
Code trang HOme Vista 2008 của SInhVienIT.NetCode trang News pro đã test by SinhVienIT.NetCode sao lưu cực kool chỉ 1 file
Share vtlai-Tutorial lib 1.0 - Code trang @tutCode quản lý điểm, tra điểm học sinhThư viện bài giảng tin học trực tuyến
Trả Lời Với Trích Dẫn
Quảng cáo
Trả lời Gởi Ðề Tài Mới

Đánh dấu
  • Submit Thread to del.icio.us del.icio.us
  • Submit Thread to Digg Digg
  • Submit Thread to StumbleUpon StumbleUpon
  • Submit Thread to Google Google
  • Submit Thread to FaceBook FaceBook

Tags
bên, bạn, cái, dùng, docking, functionality, implement, jquery, khow, kiểu, mới, menu, muốn, này, rất, trài

« Ðề Tài Trước | Ðề Tài Kế »

Ðang đọc: 1 (0 thành viên và 1 khách)
 
Ðiều Chỉnh
Tạo trang in Tạo trang in
Email trang này Email trang này

Quyền viết bài
Bạn không thể gửi chủ đề mới
Bạn không thể gửi trả lời
Bạn không thể gửi file đính kèm
Bạn không thể sửa bài viết của mình

BB code is Mở
Mặt cười đang Mở
[IMG] đang Mở
HTML đang Tắt

Nội quy diễn đàn
Chuyển đến

Các chủ đề tương tự
Chủ đề Người khởi xướng chủ đề Diễn đàn Trả lời Bài mới gửi
Bạn có thích kiểu menu ảnh rất đẹp này ko? | jqDock - jQuery Fish Eye Menu Vũ Thanh Lai JavaScript / Ajax 3 13-07-2009 03:25 PM
Tạo menu đổ xuống cho vbb Vũ Thanh Lai Mod VBB 3.7.x 0 19-05-2009 01:07 AM
Flash Menu Labs v2.08 + Crack - Tạo Flash Menu cho Website Vũ Thanh Lai Công cụ cho webmaster 1 16-05-2009 10:22 AM
Hướng dẫn tạo menu dạng cây phân cấp bằng Javascript và CSS Vũ Thanh Lai HTML & CSS 0 15-05-2009 02:33 PM
AllyNova Tree Menu v2.5 - Tạo cây Menu cho Website dễ dàng Vũ Thanh Lai Công cụ cho webmaster 0 15-05-2009 02:27 PM


Múi giờ GMT. Hiện tại là 11:28 AM
Powered by: vBulletin v3.8.2 Copyright ©2000-2010, Jelsoft Enterprises Ltd.
Xây Dựng Và Phát Triển Bởi Các Thành Viên SinhViênIT.Net
Liên hệ: Email VuThanhLai@Gmail.Com | Admin@SinhVienIT.Net
Ghi rõ nguồn SinhVienIT.Net khi sao chép bài ở đây !
Dong Ho, Vang Bac, Nhẫn Cưới, Nhan Cuoi, Trang Sức, Trang Suc, Camera Quan Sat, May Phat Dien, Iphone 3G 16Gb, May phat dien, Chuyen Nha, Chuyen Van Phong, Chuyen Nha Tron Goi, Laptop, Laptop gia re, Tuoi tu dong, dai phun nuoc, May Phat Dien | Văn Phòng Phẩm | My Pham, Noi That Hoa Phat, Tu Bep, Bep ga, Bang Dien Tu, Vach Ngan, Mp3, Kinh Mat, Kinh Thuoc, Ao Cuoi, Cân Điện Tử, May Lanh

Ban Quản Trị - Bookmarks - Liên hệ - Diễn đàn - Lưu Trữ - Lên trên
 

Trang chủ | Diễn đàn | Thư viện Tutorial | Tin tức CNTT | Việc làm | Công cụ | Server Upload
  • Ẩn
  • Đóng
 Quảng cáo

SinhVienIT.NET
Trang này đã chuyển sang link mới, mời bạn click vào link bên dưới để xem nội dung

http://sinhvienit.net/@forum/showthread.php?t=8716