javascript網頁代碼大全 js網頁設計源碼
介紹VvvebJs是一個開源的網頁拖拽自動生成的JavaScript庫,你可以以簡單拖拽的方式生成自己需要的網頁樣式,內置jquery和Bootstrap,你可以拖拽相關的組件進行網頁的構建,非常的方便,而且可以實時修改代碼,功能豐富,使用簡單,界面友好,特別適合一些專注于展示的網頁設計,需要的朋友不可錯過!

文章插圖
Github地址
https://github.com/givanz/VvvebJs相關特性
- 1、組件和塊/片段拖放 。
- 2、撤銷/重做操作 。
- 3、一個或兩個面板界面 。
- 4、文件管理器和組件層次結構導航添加新頁面 。
- 5、實時代碼編輯器 。
- 6、包含示例php腳本的圖像上傳 。
- 7、頁面下載或導出html或保存頁面在服務器上包含示例PHP腳本 。
- 8、組件/塊列表搜索 。
- 9、Bootstrap 4組件等組件
使用方式如下代碼:
<!-- jquery--><script src="https://www.cnfyg.com/shcs/js/jquery.min.js"></script><script src="https://www.cnfyg.com/shcs/js/jquery.hotkeys.js"></script><!-- bootstrap--><script src="https://www.cnfyg.com/shcs/js/popper.min.js"></script><script src="https://www.cnfyg.com/shcs/js/bootstrap.min.js"></script><!-- builder code--><script src="https://www.cnfyg.com/shcs/libs/builder/builder.js"></script><!-- undo manager--><script src="https://www.cnfyg.com/shcs/libs/builder/undo.js"></script><!-- inputs--><script src="https://www.cnfyg.com/shcs/libs/builder/inputs.js"></script><!-- components--><script src="https://www.cnfyg.com/shcs/libs/builder/components-bootstrap4.js"></script><script src="https://www.cnfyg.com/shcs/libs/builder/components-widgets.js"></script><script>$(document).ready(function() {Vvveb.Builder.init('demo/index.html', function() {//load code after page is loaded hereVvveb.Gui.init();});});</script>要初始化編輯器,調用Vvveb.Builder.init 。第一個參數是要加載以進行編輯的URL,它必須位于相同的子域中才能進行編輯 。第二個參數是頁面加載完成時調用的函數,默認情況下調用編輯器Gui.init();
- 結構

文章插圖
Component Group是一個組件集合,例如Bootstrap 4組由Button和Grid等組件組成,該對象僅用于在編輯器左側面板中對組件進行分組 。例如,Widgets組件組只有兩個組件視頻和地圖,并被定義為如下
Vvveb.ComponentsGroup['Widgets'] = ["widgets/googlemaps", "widgets/video"];Component是一個對象,它提供可以在畫布上放置的html以及在選擇組件時可以編輯的屬性,例如Video Component,具有Url和Target屬性的html鏈接Component定義為:
Vvveb.Components.extend("_base", "html/link", { nodes: ["a"], name: "Link", properties: [{ name: "Url", key: "href", htmlAttr: "href", inputtype: LinkInput }, { name: "Target", key: "target", htmlAttr: "target", inputtype: TextInput }]});在Component屬性集合中使用Input對象來編輯屬性,例如文本輸入,選擇,顏色,網格行等 。例如,TextInput擴展Input對象并定義為:
var TextInput = $.extend({}, Input, { events: { "keyup": ['onChange', 'input'], },setValue: function(value) {$('input', this.element).val(value);},init: function(data) {return this.render("textinput", data);}, });輸入還需要一個在編輯器html(在editor.html中)定義為<script>標簽的模板,其id為vvveb-input-inputname,例如對于文本輸入為vvveb-input-textinput,定義:
<script id="vvveb-input-textinput" type="text/html"><div><input name="{%=key%}" type="text" class="form-control"/></div></script>以上是借助瀏覽器翻譯工具,對官網的文檔進行簡單的翻譯,可能會有些不夠準確的地方,感興趣的小伙伴可以直接查看相關文檔!
設計界面預覽

文章插圖

文章插圖

文章插圖

文章插圖
總結【javascript網頁代碼大全 js網頁設計源碼】VvvebJs是一個非常強大的網頁可視化生成構建工具,讓不懂網頁設計的小伙伴們也能夠通過拖拽來生成美觀大方的網頁出來,讓設計網頁就像設計圖片一樣,VvvebJs特別適合展示型網頁,甚至可以不需要代碼就能完成一項復雜的網頁設計,總體來說,VvvebJs是一個值得嘗試的工具!
推薦閱讀
- git上傳本地代碼到指定的倉庫 git上傳代碼到碼云步驟
- dnf全屏999999秒殺代碼 dnf全屏代碼大全
- 電子商務專業代碼是什么
- r語言代碼大全及注解 r語言視頻教程
- 詳解html跳轉到指定頁面 html跳轉頁面代碼
- nike促銷代碼怎么得到
- H5移動端輪播圖代碼分享 移動端輪播圖插件推薦
- 教你javascript實時獲取鼠標位置 js獲取鼠標點擊的位置
- 俠盜獵車秘籍有哪些 俠盜獵車作弊全靠這些代碼
- 判斷閏年的c語言程序 九九乘法表c語言編程代碼
