Just starting out? Need help? Post your questions and find answers here.
ebelouet
 
Posts: 9
Joined: Mon Apr 08, 2019 9:46 am

LoadScript() and bootstrap

by ebelouet Fri Nov 29, 2019 4:41 pm

Hi,

I search a example with bootstrapp and spider basic.

Sincerely
Eric
User avatar
Danilo
 
Posts: 44
Joined: Wed Feb 26, 2014 7:11 am

Re: LoadScript() and bootstrap

by Danilo Fri Nov 29, 2019 7:37 pm

Small example:

Code: Select all
Procedure FloatingWin(id.s, x, y, width, height, backgroundColor.s="#ffffff", content.s="")
    Protected s.s = "<div id='"+id+"' style='position: absolute; left: "+x+"px; top:"+y+"px; width:"+width+"px; height:"+height+"px; background-color:"+backgroundColor+";'>"+content+"</div>"
    !$("body").append(v_s);
EndProcedure

Procedure BootstrapMain(URL$, Success)
    If Success
        ; https://getbootstrap.com/docs/4.4/components/alerts/
        FloatingWin("alert1",10,10,800,50,"#ffff00",
                    "<div class='alert alert-danger' role='alert'>"+
                    "A simple danger alert With <a href='#' class='alert-link'>an example link</a>. Give it a click If you like.</div>")
       
        ; https://getbootstrap.com/docs/4.4/components/navs/
        FloatingWin("popup1",50,90,710,50,"#000000",
                    "<nav class='nav'>"+
                    "<a class='nav-link active' href='#'>Active</a>"+
                    "<a href='https://www.spiderbasic.com' class='nav-link' href='#'>SpiderBasic</a>"+
                    "<a href='http://forums.spiderbasic.com/' class='nav-link' href='#'>SB Forum</a>"+
                    "<a href='https://www.purebasic.com' class='nav-link' href='#'>PureBasic</a>"+
                    "<a href='https://www.purebasic.fr/english/index.php' class='nav-link' href='#'>PB Forum</a>"+
                    "<a class='nav-link' href='#'>Link</a>"+
                    "<a class='nav-link disabled' href='#' tabindex='-1' aria-disabled='true'>Disabled</a>"+
                    "</nav>")
       
    Else
        Debug "Error while loading: "+URL$
    EndIf
EndProcedure

Procedure LoadBootstrapCSS(URL$, Success)
    If Success
        LoadScript("https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js", @BootstrapMain())
    Else
        Debug "Error while loading: "+URL$
    EndIf
EndProcedure

LoadScript("https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css", @LoadBootstrapCSS(),#PB_Script_CSS)
cya,
...Danilo
ebelouet
 
Posts: 9
Joined: Mon Apr 08, 2019 9:46 am

Re: LoadScript() and bootstrap

by ebelouet Sat Dec 07, 2019 5:01 pm

hi
Thank you very much, it's work fine.
eric
Return to Coding Questions

Who is online

Users browsing this forum: No registered users and 1 guest