Frame - yog dab tsi? Ncej qauv thiab creation

Cov txheej txheem:

Frame - yog dab tsi? Ncej qauv thiab creation
Frame - yog dab tsi? Ncej qauv thiab creation
Anonim

Ib lub thav duab yog thaj chaw ntawm ib qhov chaw (qhov rai) uas pom lwm nplooj ntawv web. Webmasters siv lub sijhawm no los nthuav qhia lub vev xaib ntawm lawv cov phooj ywg lossis cov koom tes 'qhov chaw. Tib txheej txheem yog siv los tso saib daim ntawv tshawb fawb hauv cov thawv nrog cov txiaj ntsig ntawm nws, thiab lwm yam.

Tab sis feem ntau cov thav ntawv yog siv hauv kev tsim cov vev xaib loj, qhov xav tau ntau ntawm cov khoom noj khoom haus thiab cov ntawv teev npe. Lawv feem ntau hais txog cov neeg zoo li no: "website on frames". Yuav tsum muaj kev paub zoo ntawm HTML los tsim cov peev txheej zoo li no.

Creating thav duab hauv lub vev xaib tsim

Qee lub vev xaib tsim muab cov cim tsis siv neeg lub cim. Feem ntau cov khawm ntxiv yog nyob rau hauv cov ntawv qhia zaub mov tseem ceeb ntawm qhov program. Ua ntej koj yuav tsum tso tus cursor nyob rau hauv qhov chaw ntawm nplooj ntawv, ces nias lub pob, lub qhov rais yuav qhib (raws li qhia nyob rau hauv lub screenshot). Hauv nws, koj tuaj yeem teeb tsa qhov chaw nyob ntawm nplooj ntawv uas yuav qhib rau hauv tus ncej, thiab kho qhov ntev: dav thiab qhov siab.

Tab sis feem ntau cov thav ntawv yog siv hauv kev tsim cov vev xaib loj, qhov xav tau ntau ntawm cov khoom noj khoom haus thiab cov ntawv teev npe. Lawv feem ntau hais txog cov neeg zoo li no: "website on frames". Txhawm rau tsim cov peev txheej zoo li no yuav tsum muaj kev paub zooHTML lus.

tsim thav duab
tsim thav duab

Nrog kev pab los ntawm "kev pabcuam" no nws tuaj yeem tsim tau ntau lub thav duab ntawm nplooj ntawv, tab sis koj yuav tsis tau txais cov ntsiab lus sib cuam tshuam hauv txoj kev no.

Frames hauv CMS

Nyob rau hauv ntau qhov kev pab cuam rau kev tsim cov vev xaib, nws muaj peev xwm los nruab qhov sib thooj module. Piv txwv li, rau Joomla, tus ncej yog "Wrapper" module.

ncej nws
ncej nws

Nws tuaj yeem pom thiab tsim nyob rau hauv Joomla CMS tswj vaj huam sib luag: "Extensions" - "Module Manager" - "Tsim" (ib puag ncig txiv kab ntxwv khawm nrog ib qho ntxiv kos npe sab hauv). Hauv qhov rai pop-up, hauv daim ntawv teev npe, koj yuav pom "Wrapper" module.

Yog tsis nyob ntawm no, tsis suav nrog. Txhawm rau siv nws, koj yuav tsum xub qhib nws ntawm no: "Extensions" tab, tom qab ntawd "Extension Manager", tom qab ntawd "Kev Tswj" tab. Thiab peb tab tom saib hauv daim ntawv uas qhib, rau kev tshawb nrhiav ceev hauv "Filter", sau lo lus: Wrapper. Tawm tsam qhov module no yuav tsum muaj lub cim ntsuab nrog lub cim kos hauv. Lub voj voog liab uas muaj cov ntsiab lus hauv yuav txhais tau tias lub plugin no tsis ua haujlwm.

Tom qab cov txheej txheem no, koj tuaj yeem rov qab mus rau "Module Manager", tsim ib lub thav duab thiab teeb tsa nws cov kev txwv.

dab tsi yog ib tug ncej
dab tsi yog ib tug ncej

Raws li koj tuaj yeem pom hauv daim duab, lub module tso cai rau koj los teeb tsa: lub npe saum toj no tus ncej, txoj hauj lwm ntawm lub module, xaiv cov nplooj ntawv ntawm qhov chaw uas nws yuav tshwm sim. Thiab kuj kho qhov dav, qhov siab; ntxiv tus ncej thiab ua tautxuas mus rau nplooj ntawv web. Yog hais tias nyob rau hauv ib tug ncej koj xav tso saib lub ntsiab nplooj ntawv nyob rau hauv tag nrho cov dav, ces 100%, teem los ntawm lub neej ntawd, yuav tsis txaus. Koj tuaj yeem tso 400% sai sai. Qhov siab ntawm 200 feem ntau yog txaus los tso saib cov ntawv qhia zaub mov saum toj kawg nkaus ntawm nplooj ntawv. Tag nrho lwm cov ntsiab lus yuav pom yog tias tus neeg siv (tus neeg saib xyuas lub vev xaib) siv lub scrollbar.

Ntawm no yog ib qho piv txwv ntawm qhov thav duab nyob hauv Joomla.

ua piv txwv
ua piv txwv

Jumla module rau kev tsim cov ncej yog yooj yim heev thiab siv tau yooj yim. Txawm li cas los xij, nws lub peev xwm raug txwv, ib yam li lub peev xwm ntawm tus tsim.

keeb kwm thiab qhov tseeb

Nyob rau hauv kev xyaum tsim cov chaw los ntawm thav ntawv, daim ntawv lo (nws daim ntawv thov) tau ploj mus ntev rau hauv keeb kwm yav dhau. Lawv tuaj yeem hloov tau los ntawm cov qauv, cov chaw hauv cov kev tsim kho uas tsim cov cai rau nplooj ntawv web yam tsis muaj kev koom tes ntawm tus tsim lub vev xaib. Txawm li cas los xij, qee zaum qhov no tsis txaus. Piv txwv li, thaum lub thav duab yog ib tug holistic complex qauv ntawm cov cheeb tsam tso tawm nyob rau hauv lub browser. Qhov no yog li cas cov tswv ntawm cov txheej txheem nyuaj pom nws. Nws cov creation tsuas yog siv rau hauv cov xwm txheej hnyav, txij li cov chaw tsim khoom tshwj xeeb nrog kev pab los ntawm cov cim tshwj xeeb.

cov chaw ua haujlwm nyuaj

Rau lawv, tsim ntau qhov kev sib txuas sib txuas yog qhov kev daws teeb meem zoo tshaj plaws rau kev teeb tsa cov ntsiab lus ntawm cov nplooj ntawv peev txheej. Cov no yog, raws li txoj cai, loj portals, loj hlob muaj zog txhua txhua xyoo.

Yuav ua li cas thiaj ua tau zoo ib yam? Tus qauv tsim li cas?

ncej qauv
ncej qauv

Howntxig thav duab rau hauv nplooj ntawv code

Frames hauv HTML tau ntxiv siv cov cim:

  • frame (rau lub qhov rais cais);
  • frameset (siv nws los tsim ib qho qauv);
  • iframe ("floating" ncej);
  • noframes (yog tias tus ncej tsis tshwm nyob rau hauv tus neeg siv tus browser).

thawj daim tag ib txwm haum rau ib khub thiab. Thiab nws hloov thiab. Thiab nrog kev pab los ntawm cov yam ntxwv tsim nyog, koj tuaj yeem kho cov yam ntxwv ntawm txhua lub ntsiab lus: lub npe (npe=), qhov loj (cols=thiab rows=), lub xub ntiag ntawm ciam teb (ciam teb), qhov tshwm sim ntawm scrollbar thiab, tau kawg, qhov txuas mus rau nplooj ntawv web los tso saib.

Tsim variations

Tag nrho nplooj ntawv ntawm lub xaib tuaj yeem muab faib ua thaj chaw. Piv txwv li, zoo li no:

Luag Top frame
Raws

Cov qauv zoo li no (nws hu ua nested) tuaj yeem tau txais los ntawm kev sau cov cim cols hauv daim ntawv cim npe, uas txhais tau tias tus ncej qhov chaw nyob horizontally, thiab kab - vertically. Tom ntej no, lub=kos npe yog muab tso thiab qhov ntev yog sau. Piv txwv li, 60%, 40% - feem pua (ib lub qhov rais yuav siv 60% ntawm qhov chaw browser, lwm qhov, feem, 40%). Los yog 100, 200 - nam piv hauv pixels. Qhov loj ntawm ib qho ntawm cov thav duab tsis tuaj yeem teeb tsa txhua qhov (nws yuav raug teeb tsa los ntawm lub neej ntawd). Txhawm rau ua qhov no, tom qab lossis ua ntej tus lej cim, koj yuav tsum qhia lub cim.

Nkaujtxhua qhov chaw tshiab yog qhia los ntawm lub teeb tshiab.

Code piv txwv:

Nco ntsoov tias hauv peb qhov piv txwv, rau qhov thib ob thiab thib peb thav ntawv, qhov ntau thiab tsawg tau teev tseg ib zaug xwb.

Ntau lub tswv yim tso cai rau koj ua kom tiav thav duab. Piv txwv ntawm lawv qhov chaw nyob hauv qhov browser qhov rai tuaj yeem muab tsis tau kawg (hloov cov cai raws li). Txawm li cas los xij, cov ntaub ntawv no tsis tau pom daim ntawv thov siv tau ntev. Ncej, yog siv niaj hnub no thaum tsim cov chaw, tsuas yog nyob rau hauv daim ntawv ntawm modules dawb CMS los yog nyob rau hauv daim ntawv ntawm ib tug iframe.

Floating frame

site ntawm thav duab
site ntawm thav duab

Nws txawv txawv vim li cas thiaj tau lub npe zoo li no, lo lus "built-in" yog tsim nyog ntawm no. Cov ncej no yog tsim los tso saib cov ntsiab lus ntawm cov ntaub ntawv. Koj upload cov ntaub ntawv lossis cov ntaub ntawv rau hauv cov ntaub ntawv, sau txoj hauv kev rau nws siv iframe tags - thiab cov neeg tuaj saib yuav pom cov ntawv ntawm cov ntaub ntawv (video lossis duab). Hmoov tsis zoo, browsers tsis tas yuav ua cov ntsiab lus. Txhawm rau ua qhov no, cov neeg tsim lub vev xaib nkag mus rau kab lus ntawm qhov qhib thiab kaw cov cim npe: "Koj tus browser tsis pom cov ntsiab lus."

Piv txwv li, Seopult.ru yog qhov kev pabcuam zoo tshaj plaws rau qib masters. Tsuas yog tsis yog nws lub vev xaib tseem ceeb, tab sis daim iav I.seopult.pro, tsim rau cov neeg siv khoom portal. Tus lej iframe tau sau ntawm no raws li hauv qab no:

Kev qhia

. Tag

  • tau tsim los txhais cov npe khoom. Txhawb nqa los ntawm txhua tus browsers.

    Ntawm daim iav nplooj ntawv nws tus kheej, koj tuaj yeem pom lo lus "Kev qhia" hauv daim ntawv khawm. Nyem rau ntawm nws hauv nruab nrab ntawm qhov browser qhov rai qhib qhov kev nthuav qhia.

    Txhua tus lojcov chaw saib yeeb yaj kiab thiab yeeb yaj kiab raug tsim los siv iframes (piv txwv li, "Imhonet"), nrog rau kev sib tham. Txawm tias nplooj ntawv tseem ceeb ntawm "Yandex" muaj cov cim no, thiab ntau dua ib khub.

    Yuav ua li cas sau ib iframe

    Koj tuaj yeem muab cov ntaub ntawv tso rau hauv daim ntawv ntawm lub qhov rais nrog scroll bar rau txhua qhov chaw ntawm lub xaib. Feem ntau cov cim npe muab tso rau hauv lub cev. Tshaj tus qauv

    thiab, raws li qhia hauv qhov piv txwv saum toj no, daim ntawv teev npe kuj siv tau -

    • Tus cwj pwm raug ntxiv rau iframe:

      • dav (dav) thiab qhov siab (qhov siab=);
      • ntug alignment;
      • indents uas tej zaum yuav lossis tsis tau teev tseg: tus nqi pib yog 6 - qhov no txaus;
      • siv kev tso cai pom zoo, koj tuaj yeem teeb pom qhov pom tseeb ntawm thaj chaw ncej kom pom cov keeb kwm yav dhau los;
      • plus tus paub scr, npe, scrolling, ciam teb.

      Navigating nrog iframe

      Qhov kev nthuav dav tshaj plaws yog sau cov cai uas tso cai rau koj qhib cov ntsiab lus hauv lub qhov rais los ntawm qhov txuas, uas yog qhov uas tus tsim ntawm Seopult daim iav tau ua, tsuas yog muaj ntau qhov txuas ib zaug (ib txhij muaj rau tus neeg siv ntawm tib nplooj).

      Rau qhov no, ib qho iframe raug coj, lub npe tseem sau rau hauv nws los ntawm lub npe=. Piv txwv li, header. Tsis tas li ntawd, ua ntej nws nyob rau hauv cov cim npe thiab cov ntawv txuas tau sau los ntawm HREF=nrog rau qhov yuav tsum tau ua ntawm tus cwj pwm tom qab lawv. Tags "a" qhib thiab kawmuaj nyob rau hauv tag p.

      Koj tuaj yeem sau ntau cov kab hauv kab hauv kab hauv qab kom thiaj li tau txais ntau qhov txuas khawm hauv ib kab ntawm lub xaib, nyem rau ntawm cov ntsiab lus sib txawv yuav tshwm sim hauv lub qhov rai hauv qab no.

      Tus lej yuav zoo li no:

      Post ib ad

      View Ads

      Image
      Image

      Nws yuav zoo li cas hauv lub vev xaib:

      Yuav ua li cas ntxig ib iframe rau hauv Joomla site

      Raws li tus qauv, Joomla tswj vaj huam sib luag muaj qhov qhib tau (npaj-rau-siv) "HTML-code" module. Nrog nws, koj tuaj yeem ntxig txhua qhov chaws nyob qhov twg ntawm qhov chaw. Txawm li cas los xij, nws tawv ncauj tsis quav ntsej cov cai nrog iFrem tag. Yog li ntawd, peb yuav siv qhov tshwj xeeb Jumi module.

      Ua ntej tshaj, koj yuav tsum rub tawm hauv Is Taws Nem thiab nruab nws los ntawm Joomla tus thawj tswj vaj huam sib luag: "Extensions" - "Extension Manager" - "Xaiv cov ntaub ntawv". Qhia meej txog txoj hauv kev mus rau cov ntaub ntawv rub tawm thiab nyem "Download".

      Tom qab kev teeb tsa tiav, mus rau "Module Manager" thiab tsim ib qho tshiab. Xaiv hom Jumi. Nyob rau hauv lub qhov rais uas qhib, nyob rau hauv lub "Custom Code", nkag mus rau lub npaj iFrem, raws li qhia nyob rau hauv cov nqe lus dhau los ntawm tsab xov xwm. Muab lub npe rau lub module, qhia qhov chaw tso chaw thiab nplooj ntawv chaw. Nyem save thiab saib nws.

      Browsers thiab ntas

      Tag nrho cov browsers nrov tso saib cov ntsiab lus ntawm lub qhov rais zoo: Chrome, Safari, Firefox, Android, iOS. Internet Explorer thiab Opera muaj tus nqi tshwj xeeb hauv qhov no. Thiab tseem tsis muaj qhov lavtias tus qhua rau koj qhov chaw yuav pom cov ntsiab lus ntawm txhua qhov rais. Hauv qhov no, koj yuav tsum tso cov lus uas siv lub npe noframe (qhib thiab kaw). Koj tuaj yeem nkag mus rau hauv qab no rau hauv nws: "Koj tus browser tsis dhau hnub. Hloov kho cov ntawv los tso saib cov ntsiab lus ntawm qhov chaw." Yog hais tias tus neeg siv lub browser ua thav duab kom raug, lawv yuav tsis pom cov lus no.

      Yog li tus ncej yog thaj chaw lossis qhov rais ntawm qhov chaw uas muaj nws tus kheej URL. Siv los tso saib ntau nplooj ntawv web lossis cov ntaub ntawv ywj pheej hauv ib qhov browser ib zaug, kuj muaj lawv tus kheej URL. Txawm tias muaj tseeb hais tias thav duab tso cai rau koj los npaj ib qho chaw zoo, lawv tsis tau siv ntev, tsuas yog rau iframe. Kev siv cov cim npe no tseem muaj feem cuam tshuam rau kev thauj khoom nthuav tawm, video player, ntawv nyeem cov ntaub ntawv hauv lub qhov rais tshwj xeeb. Nws tau nquag siv los ntawm cov peev txheej loj thiab paub zoo hauv lub vev xaib.

Pom zoo: